/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = DateRepair::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id_date_repair' => $this->id_date_repair, 'begin_day' => $this->begin_day, 'repair_day' => $this->repair_day, 'repair_complete_day' => $this->repair_complete_day, 'wagon_wagon_id' => $this->wagon_wagon_id, 'brand_repair_brand_repair_id' => $this->brand_repair_brand_repair_id]); return $dataProvider; }
/** * Finds the DateRepair model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return DateRepair the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = DateRepair::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getDateRepairs() { return $this->hasMany(DateRepair::className(), ['wagon_wagon_id' => 'wagon_id']); }
/** * @return \yii\db\ActiveQuery */ public function getDateRepairs() { return $this->hasMany(DateRepair::className(), ['brand_repair_brand_repair_id' => 'brand_repair_id']); }