/** * @return AppAttachment[] * @throws \Exception */ public function getFiles() { $fileQuery = AppAttachment::find()->where(['item_id' => $this->owner->id, 'model' => $this->getModule()->getShortClass($this->owner)]); $fileQuery->orderBy(['id' => SORT_ASC]); return $fileQuery->all(); }