public function getPhotos() { if (!$this->_photos) { $this->_photos = []; foreach (Photo::find()->where(['class' => ContentArticles::className(), 'item_id' => $this->id])->sort()->all() as $model) { $this->_photos[] = new PhotoObject($model); } } return $this->_photos; }
public function behaviors() { return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]], ['class' => StatusController::className(), 'model' => ContentArticles::className()]]; }