refactored data providers.

This commit is contained in:
Qiang Xue
2013-10-01 21:35:35 -04:00
parent 2c30ddfcb0
commit 0035f23781
7 changed files with 236 additions and 215 deletions

View File

@ -18,6 +18,18 @@ namespace yii\data;
*/
interface DataProviderInterface
{
/**
* Prepares the data models and keys.
*
* This method will prepare the data models and keys that can be retrieved via
* [[getModels()]] and [[getKeys()]].
*
* This method will be implicitly called by [[getModels()]] and [[getKeys()]] if it has not been called before.
*
* @param boolean $forcePrepare whether to force data preparation even if it has been done before.
*/
public function prepare($forcePrepare = false);
/**
* Returns the number of data models in the current page.
* This is equivalent to `count($provider->getModels())`.