/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Taller::find(); // add conditions that should always apply here $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; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'estadoTaller_id' => $this->estadoTaller_id, 'colaborador_id' => $this->colaborador_id, 'entidad_id' => $this->entidad_id, 'horas' => $this->horas, 'comunas_comuna_id' => $this->comunas_comuna_id]); $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'area', $this->area])->andFilterWhere(['like', 'totalParticipantes', $this->totalParticipantes])->andFilterWhere(['like', 'lugarDireccion', $this->lugarDireccion]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getTallers() { return $this->hasMany(Taller::className(), ['estadoTaller_estado' => 'estado']); }
/** * Finds the Taller model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Taller the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Taller::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getTallers() { return $this->hasMany(Taller::className(), ['area_area' => 'area']); }
/** * @return \yii\db\ActiveQuery */ public function getTallers() { return $this->hasMany(Taller::className(), ['colaborador_id' => 'id']); }
public function search(Request $request) { $talleres = Taller::where('nombre_taller', 'like', '%' . $request->nombre . '%')->get(); return \View::make('Taller/list_taller', compact('talleres')); }
/** * @return \yii\db\ActiveQuery */ public function getTallers() { return $this->hasMany(Taller::className(), ['entidad_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getTallers() { return $this->hasMany(Taller::className(), ['id' => 'taller_id'])->viaTable('taller_has_participante', ['participante_id' => 'id']); }