예제 #1
0
 protected function findModel($id)
 {
     if (($model = \app\models\db\Books::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('Страница не найдена.');
     }
 }
예제 #2
0
파일: Authors.php 프로젝트: kbulaeva/books
 public function getBooks()
 {
     return $this->hasMany(Books::className(), ['author_id' => 'id']);
 }