public function getPhotos() { return $this->hasMany(Photo::className(), ['item_id' => 'item_id'])->where(['class' => self::className()])->sort(); }
public function behaviors() { return [['class' => 'yii\\filters\\ContentNegotiator', 'formats' => ['application/json' => Response::FORMAT_JSON]], ['class' => SortableController::className(), 'model' => Photo::className()]]; }
public function getPhotos() { return $this->hasMany(Photo::className(), ['item_id' => 'album_id'])->where(['model' => Album::className()])->sort(); }