Exemplo n.º 1
0
 public function getAttachments()
 {
     return $this->hasMany(Attachment::className(), ['document_id' => 'id']);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAttachments()
 {
     return $this->hasMany(Attachment::className(), ['document_id' => 'id'])->orderBy('priority');
 }
Exemplo n.º 3
0
 public function actionDownload($id)
 {
     $model = $this->findModel(Attachment::className(), $id);
     $this->checkPermission($model);
     return $this->download($model->getPath());
 }