From d5c3ac85766dcd7e82b805ac693e67ebdeaec9c3 Mon Sep 17 00:00:00 2001 From: Grant Furgiuele Date: Sat, 15 Mar 2014 16:09:30 -0500 Subject: [PATCH 1/4] Modified example in DataReader usage comment to reference a DB Command function which accepts a SQL string argument. --- framework/db/DataReader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index 213db52b6e..30aab7ec23 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -17,7 +17,7 @@ use yii\base\InvalidCallException; * iterating through the reader. For example, * * ~~~ - * $reader = $command->query('SELECT * FROM tbl_post'); + * $reader = $command->setSql('SELECT * FROM tbl_post'); * * while ($row = $reader->read()) { * $rows[] = $row; From cf42b74f7cc131414d614cf53d5633b58feb489b Mon Sep 17 00:00:00 2001 From: Grant Furgiuele Date: Tue, 18 Mar 2014 15:21:43 -0500 Subject: [PATCH 2/4] Changed comment again to actually be correct. This is also consistent with the draft of the definitive guide. --- framework/db/DataReader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index 30aab7ec23..678a383136 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -17,7 +17,8 @@ use yii\base\InvalidCallException; * iterating through the reader. For example, * * ~~~ - * $reader = $command->setSql('SELECT * FROM tbl_post'); + * $command = $connection->createCommand('SELECT * FROM tbl_post'); + * $reader = $command->query(); * * while ($row = $reader->read()) { * $rows[] = $row; From bc91853e3f9ccfcaa21420c395613b0248702faf Mon Sep 17 00:00:00 2001 From: Grant Furgiuele Date: Sat, 15 Mar 2014 16:09:30 -0500 Subject: [PATCH 3/4] Modified example in DataReader usage comment to reference a DB Command function which accepts a SQL string argument. --- framework/db/DataReader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index bec616c9c5..bb27e5417c 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -17,7 +17,7 @@ use yii\base\InvalidCallException; * iterating through the reader. For example, * * ~~~ - * $reader = $command->query('SELECT * FROM tbl_post'); + * $reader = $command->setSql('SELECT * FROM tbl_post'); * * while ($row = $reader->read()) { * $rows[] = $row; From ed2885c31d6e618f2aea27ea3d1765d7a9334471 Mon Sep 17 00:00:00 2001 From: Grant Furgiuele Date: Tue, 18 Mar 2014 15:21:43 -0500 Subject: [PATCH 4/4] Changed comment again to actually be correct. This is also consistent with the draft of the definitive guide. --- framework/db/DataReader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index bb27e5417c..36a38ac062 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -17,7 +17,8 @@ use yii\base\InvalidCallException; * iterating through the reader. For example, * * ~~~ - * $reader = $command->setSql('SELECT * FROM tbl_post'); + * $command = $connection->createCommand('SELECT * FROM tbl_post'); + * $reader = $command->query(); * * while ($row = $reader->read()) { * $rows[] = $row;