An easy way to use escopes and CActiveDataProvider

Comparing #2 with #3

Content

[...]
Eg:

```php
$ DataProvider = new CActiveDataProvider ('Post', array (
'
Ccriteria' => array ( 'Condition' => 'status = 1' 'Order' => 'DESC create_time' 'With' => array ('author') ) 'Ppagination' => array (
'PageSize' => 20,
)
[...]
```php
class MyActiveRecord extends CActiveRecord class extends {

/ **
[...]
* @ Return CActiveDataProvider
* /
public function getDataProvider
 ($ crit = eria=null, $ pagination = =null) {  if ((is_array ($ criteria)) | | $ CDbC($criteria instanceof CDbCriteria) )  $ T$this-> getDbCriteria () -> mergeWith ($ criteria);      $ P$pagination = CMap:: mergeArray (array ('pageSize' => 10), (array) $ pagination); return new CActiveDataProvider (__CLASS__, array ( 
 
(
 
   
'C         'criteria' => $ $this-> getDbCriteria (),          'P    'pagination' => $ pagination 'with' => array ('author') 
 
        )); 
 
    } 

 
        ));
 
    }
 

 
```
 
 
Edit the model...
 
 
```php 
class Post extends MyActiveRecord {
 
...
} 
```
[...]
```php
$ DataProvider = Post::
 model () -> with ('author') -> active () -> getDataProvider (); ... $ DataProvider = Post:: model () -> with ('author') -> active () -> getDataProvider (array ('order' => 'create_time DESC')); ... $ DataProvider = Post:: model () -> with ('author') -> active () -> getDataProvider (array ('order' => 'create_time DESC'), array ('pageSize' => 25)); ``` That's it!