/** * Get file meta data * * @param integer $id file id * * @return \metalguardian\fileProcessor\models\File|null * @throws \Exception */ public function getData($id) { $model = \metalguardian\fileProcessor\models\File::findOne($id); if (!$model) { throw new \Exception(\metalguardian\fileProcessor\Module::t('exception', 'Missing meta data for file')); } return $model; }
/** * @return \yii\db\ActiveQuery */ public function getFile() { return $this->hasOne(File::className(), ['id' => 'file_id']); }