/**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('question_id', $this->question_id);
     $criteria->compare('question_body', $this->question_body, true);
     $criteria->compare('question_correct_answer_id', $this->question_correct_answer_id);
     $criteria->compare('listening_id', $this->listening_id);
     $criteria->order('RAND()');
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Exemple #2
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('nombre_comun', $this->nombre_comun, true);
     $criteria->compare('nombre_cientifico', $this->nombre_cientifico, true);
     $criteria->compare('nombre_ingles', $this->nombre_ingles, true);
     $criteria->compare('grupo', $this->grupo, true);
     $criteria->compare('familia', $this->familia, true);
     $criteria->compare('lugar', $this->lugar, true);
     $criteria->compare('talla_captura', $this->talla_captura, true);
     $criteria->compare('aprovechamiento', $this->aprovechamiento, true);
     $criteria->compare('lista_roja_iucn', $this->lista_roja_iucn, true);
     $criteria->compare('veda', $this->veda, true);
     $criteria->compare('arte_de_pesca', $this->arte_de_pesca, true);
     $criteria->compare('tipo_arte_pesca', $this->tipo_arte_pesca, true);
     $criteria->compare('generalidades', $this->generalidades, true);
     $criteria->compare('distribucion', $this->distribucion, true);
     $criteria->compare('foto', $this->foto, true);
     $criteria->compare('html', $this->html, true);
     $criteria->order('nombre_comun ASC');
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }