Object::extraSearch PHP Method

extraSearch() public static method

public static extraSearch ( $object )
    public static function extraSearch($object)
    {
        // Warning: Please modify the following code to remove attributes that
        // should not be searched.
        $criteria = new CDbCriteria();
        $criteria->compare('object_id', $object->object_id, true);
        $criteria->compare('object_author', $object->object_author, true);
        $criteria->compare('object_date', $object->object_date);
        $criteria->compare('object_content', $object->object_content, true);
        $criteria->compare('object_title', $object->object_title, true);
        $criteria->compare('object_status', $object->object_status);
        $sort = new CSort();
        $sort->attributes = array('object_id');
        $sort->defaultOrder = 'object_id DESC';
        return new CActiveDataProvider($object, array('criteria' => $criteria, 'sort' => $sort));
    }

Usage Example

Example #1
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()
 {
     return Object::extraSearch($this);
 }