Filter by function in CActiveDataProvider

Hi all,

I need filter TbGridView with used CActiveDataProvider not only in CDbCriteria but also with used function in model.




class Processing extends CActiveRecord {


    public $status = null;


    public function search() {

        $criteria = new CDbCriteria;

        ...


        return new CActiveDataProvider($this, array(

            'criteria' => $criteria,

            'pagination' => array('pageSize' => 20),

        ));

    }



Property ‘status’ is not from db, but is calculated in function with model.

"status" is integer (enum)

You have to re-construct the logic for "status" with a SQL in order to use it as a filter in CActiveDataProvaider.