/** * @return Image[] */ public function getImages() { if (!$this->_images) { $this->_images = Image::find()->innerJoin($this->junctionTable, Image::tableName() . ".id=file_id AND model=:model AND item_id=:item_id", ['item_id' => $this->owner->getPrimaryKey(), 'model' => $this->getModelShortName()])->sort()->all(); } return $this->_images; }
/** * @return string */ public function actionList() { $dataProvider = new ActiveDataProvider(['query' => Image::find()->sortDate(), 'pagination' => ['pageSize' => self::DEFAULT_PAGE_SIZE]]); return $this->render('list', ['dataProvider' => $dataProvider]); }