Exemplo n.º 1
0
 /**
  * @param TemaFilter $filter
  * @return boolean|TemaQuery
  */
 public function andFilter($filter)
 {
     if (!$filter->validate()) {
         return false;
     }
     return $this->andFilterWhere(['and', ['like', 'tema.nazvanie', $filter->nazvanie], ['prepodavatel.id' => $filter->prepodavatelId]]);
 }
Exemplo n.º 2
0
 public function actionTemaList($kurs)
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $query = Tema::find()->customInfo()->where(['kurs.id' => $kurs]);
     $filter = new TemaFilter();
     if ($filter->load(Yii::$app->request->get(), '') && !$query->andFilter($filter)) {
         throw new BadRequestHttpException();
     }
     return $query->formatted();
 }