yiisoft/yii — pull request #2872 by nineinchnick (2013-09-13 21:29:36+00:00)
Title: introduce a new createCommand() method in CActiveFinder

Resolves #2871.

Usage example:

~~~php
$dataProvider->setPagination(false);
$model = $dataProvider->model;
$baseCriteria = $dataProvider->getCriteria();
if (empty($baseCriteria->with)) {
$command = $model->getCommandBuilder()->createFindCommand($model->tableSchema, $baseCriteria);
} else {
$finder = new CActiveFinder($model, $baseCriteria->with);
$command = $finder->createCommand($baseCriteria);
}
$command->prepare();
$command->execute($command->params);
$dataReader = new CDbDataReader($command);
// now $dataReader can be used to iterate over results without reading them all into memory at once

~~~