コード例 #1
0
ファイル: Document.php プロジェクト: kmolchanov/qwintry-test
 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
ファイル: AttachmentController.php プロジェクト: vsguts/crm
 public function actionDownload($id)
 {
     $model = $this->findModel(Attachment::className(), $id);
     $this->checkPermission($model);
     return $this->download($model->getPath());
 }