mbi
(mbi)
1
an Album(id, name)
an Image (id, userId, filename)
an AlbumImage (albumId, imageId, position)
//Album.php
public function relations()
{
return array(
'images' => array(self::MANY_MANY, 'Image', 'album_image(album, imageId)')
);
}
//I want images ordered by album_image.position
$images = $album->images;
Is it possible to define a relation, that pulls all images of an album ordered by position?
mbi
(mbi)
2
public function relations()
{
return array(
'images' => array(self::MANY_MANY, 'Image', 'album_image(album, imageId)'), 'order' => 'position', 'together' => true
);
}
thanx mbi 
mbi
(mbi)
3
Question is now: how can I access the position column?
fouss
(Jsfousseni)
4
I can see that is a old post. Have you manged to acces the position column?