Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce a new createCommand() method in CActiveFinder #2872

Conversation

nineinchnick
Copy link
Contributor

Resolves #2871.

Usage example:

        $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
        // if eager loading is used, a call to $finder->populateRecord($data) is required

@cebe cebe modified the milestones: 1.1.17, 1.1.16 Dec 20, 2014
@samdark samdark closed this Jan 3, 2016
@cebe cebe removed this from the 1.1.17 milestone Jan 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add createCommand method to CActiveFinder
3 participants