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?