Add support CDbCommand in CSqlDataProvider #1500

Merged
merged 3 commits into from Oct 10, 2012

3 participants

@slavcodev

Add support CDbCommand in CSqlDataProvider

Example controller action:

$command = Yii::app()->db->createCommand();
// use query builder
$command->where(...);
// may be need
$command->setFetchMode(PDO::FETCH_OBJ);

$dataProvider = new CSqlDataProvider($command, $config);
@creocoder

Very useful feature. Vote for merge this.

@cebe cebe was assigned Oct 2, 2012
@samdark samdark commented on an outdated diff Oct 3, 2012
CHANGELOG
@@ -55,6 +55,7 @@ Version 1.1.13 work in progress
- Enh: Value of the CHtml::activeTextArea() can now be set through $htmlOptions['value'] (resurtm)
- Enh: Allow to customize CHtml::error() container tag (creocoder)
- Enh: CModule::setComponents() now can reconfigure already loaded components (creocoder)
+- Enh #1500: CSqlDataProvider now supports CDbCommand in constructor (slavcodev)
@samdark
Yii Software LLC member
samdark added a note Oct 3, 2012

Should be ordered according to Enh #.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@cebe cebe added a commit that referenced this pull request Oct 10, 2012
@cebe cebe docs for CSqlDataProvider allowing CDbCommand as SQL statement
pull request #1500
9852b65
@cebe cebe merged commit 47c9ddb into yiisoft:master Oct 10, 2012
@cebe
Yii Software LLC member

merged and added some docs, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment