예제 #1
0
 public function getAttachments()
 {
     return $this->hasMany(Attachment::className(), ['document_id' => 'id']);
 }
예제 #2
0
파일: Document.php 프로젝트: 2377635/test
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAttachments()
 {
     return $this->hasMany(Attachment::className(), ['document_id' => 'id'])->orderBy('priority');
 }
예제 #3
0
 public function actionDownload($id)
 {
     $model = $this->findModel(Attachment::className(), $id);
     $this->checkPermission($model);
     return $this->download($model->getPath());
 }