예제 #1
0
파일: Lookup.php 프로젝트: hung5s/yap
 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('name', $this->name, true);
     $criteria->compare('code', $this->code, true);
     if ($this->type == null) {
         $this->type = Lookup::firstType();
     }
     $criteria->compare('type', $this->type, true);
     $criteria->compare('position', $this->position);
     $criteria->order = 'position ASC';
     return new CActiveDataProvider(get_class($this), array('criteria' => $criteria));
 }