/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Actividad::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' => $this->id, 'activo' => $this->activo, 'id_proyecto' => $this->id_proyecto]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre]);
     return $dataProvider;
 }
 /**
  * Finds the Actividad model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Actividad the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Actividad::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     return Actividad::all();
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getActividads()
 {
     return $this->hasMany(Actividad::className(), ['area_area' => 'area']);
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getActividads()
 {
     return $this->hasMany(Actividad::className(), ['id' => 'actividad_id'])->viaTable('actividad_has_colaborador', ['colaborador_id' => 'id']);
 }
Example #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getActividads()
 {
     return $this->hasMany(Actividad::className(), ['id' => 'actividad_id'])->viaTable('actividad_has_staff', ['staff_id' => 'id']);
 }
Example #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getActividads()
 {
     return $this->hasMany(Actividad::className(), ['id' => 'actividad_id'])->viaTable('actividad_has_participante', ['participante_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getActividades()
 {
     return $this->hasMany(Actividad::className(), ['id_proyecto' => 'id']);
 }