/** * 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 searchWithNotes() { $criteria = new EMongoCriteria(); /* * arrayOfBiobanks defined in search action controller, in case of collection_id and collection_name biobank search * Has the priority on biobank selection box */ if (isset($this->gender) && !empty($this->gender) && $this->gender != "U") { $criteria->gender = "" . $this->gender . ""; } if (isset($this->id_depositor) && !empty($this->id_depositor)) { $criteria->id_depositor = "" . $this->id_depositor . ""; } if (isset($this->id_sample) && !empty($this->id_sample)) { $criteria->id_sample = "" . $this->id_sample . ""; } if (isset($this->storage_conditions) && !empty($this->storage_conditions) && $this->storage_conditions != "U") { $criteria->storage_conditions = "" . $this->storage_conditions . ""; } if (isset($this->consent) && !empty($this->consent) && $this->consent != "U") { $criteria->consent = "" . $this->consent . ""; } if (isset($this->max_delay_delivery) && !empty($this->max_delay_delivery)) { $criteria->max_delay_delivery = "" . $this->max_delay_delivery . ""; } if (isset($this->detail_treatment) && !empty($this->detail_treatment)) { $criteria->detail_treatment = "" . $this->detail_treatment . ""; } if (isset($this->disease_outcome) && !empty($this->disease_outcome)) { $criteria->disease_outcome = "" . $this->disease_outcome . ""; } if (isset($this->tumor_diagnosis) && !empty($this->tumor_diagnosis)) { $criteria->tumor_diagnosis = "" . $this->tumor_diagnosis . ""; } // // recherche dans notes if (isset($this->field_notes) && !empty($this->field_notes)) { $criteria->addCond('notes.value', '==', new MongoRegex('/' . $this->field_notes . '*/i')); } if (isset($this->field_age_min) && !empty($this->field_age_min)) { $criteria->addcond('age', '>=', strval($this->field_age_min)); } if (isset($this->field_age_max) && !empty($this->field_age_max)) { $criteria->addcond('age', '<=', strval($this->field_age_max)); } if (isset($this->arrayOfBiobanks) && is_array($this->arrayOfBiobanks) && !empty($this->arrayOfBiobanks)) { $criteria->addCond('biobank_id', 'in', $this->arrayOfBiobanks); } else { if (isset($this->biobank_id) && !empty($this->biobank_id)) { $criteria->biobank_id = "" . $this->biobank_id . ""; } } Yii::app()->session['criteria'] = $criteria; return new EMongoDocumentDataProvider($this, array('criteria' => $criteria)); }