data provider for Yii PHP based on ActiveRecord
CActiveDataProvider is part of the Yii PHP framework. Excerpt from the v1.1 docs:
CActiveDataProvider provides data in terms of ActiveRecord (AR) objects which are of class modelClass. It uses the AR CActiveRecord::findAll
method to retrieve the data from database. The criteria
property can be used to specify various query options.
CActiveDataProvider may be used in the following way:
$dataProvider=new CActiveDataProvider('Post', array(
'criteria'=>array(
'condition'=>'status=1',
'order'=>'create_time DESC',
'with'=>array('author'),
),
'countCriteria'=>array(
'condition'=>'status=1',
// 'order' and 'with' clauses have no meaning for the count query
),
'pagination'=>array(
'pageSize'=>20,
),
));
// $dataProvider->getData() will return a list of Post objects
Important Links