diff --git a/framework/db/ActiveQuery.php b/framework/db/ActiveQuery.php index 90e508f..c0293fe 100644 --- a/framework/db/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -34,9 +34,9 @@ use yii\db\Exception; * * ActiveQuery also provides the following additional query options: * - * - [[with]]: list of relations that this query should be performed with. - * - [[indexBy]]: the name of the column by which the query result should be indexed. - * - [[asArray]]: whether to return each record as an array. + * - [[with()]]: list of relations that this query should be performed with. + * - [[indexBy()]]: the name of the column by which the query result should be indexed. + * - [[asArray()]]: whether to return each record as an array. * * These options can be configured using methods of the same name. For example: * diff --git a/framework/db/Query.php b/framework/db/Query.php index cf17839..10bba08 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -10,13 +10,15 @@ namespace yii\db; /** - * Query represents a SQL statement in a way that is independent of DBMS. + * Query represents a SELECT SQL statement in a way that is independent of DBMS. * - * Query not only can represent a SELECT statement, it can also represent INSERT, UPDATE, DELETE, - * and other commonly used DDL statements, such as CREATE TABLE, CREATE INDEX, etc. + * Query provides a set of methods to facilitate the specification of different clauses + * in a SELECT statement. These methods can be chained together. * - * Query provides a set of methods to facilitate the specification of different clauses. - * These methods can be chained together. For example, + * By calling [[createCommand()]], we can get a [[Command]] instance which can be further + * used to perform/execute the DB query against a database. + * + * For example, * * ~~~ * $query = new Query; @@ -24,12 +26,11 @@ namespace yii\db; * ->from('tbl_user') * ->limit(10); * // build and execute the query - * $users = $query->createCommand()->queryAll(); + * $command = $query->createCommand(); + * // $command->sql returns the actual SQL + * $rows = $command->queryAll(); * ~~~ * - * By calling [[createCommand()]], we can get a [[Command]] instance which can be further - * used to perform/execute the DB query against a database. - * * @author Qiang Xue * @since 2.0 */ diff --git a/tests/unit/framework/db/CommandTest.php b/tests/unit/framework/db/CommandTest.php index a55a016..2a11fcb 100644 --- a/tests/unit/framework/db/CommandTest.php +++ b/tests/unit/framework/db/CommandTest.php @@ -223,7 +223,6 @@ class CommandTest extends \yiiunit\MysqlTestCase $this->assertTrue(is_array($result) && isset($result[0])); } - function testInsert() { @@ -298,34 +297,4 @@ class CommandTest extends \yiiunit\MysqlTestCase { } - - function testParams() - { - - } - - function testGetSql() - { - - } - - function testCreateCommand() - { - - } - - function testReset() - { - - } - - function testToArray() - { - - } - - function testMergeWith() - { - - } } \ No newline at end of file diff --git a/tests/unit/framework/db/ConnectionTest.php b/tests/unit/framework/db/ConnectionTest.php index 64f93be..afb4f20 100644 --- a/tests/unit/framework/db/ConnectionTest.php +++ b/tests/unit/framework/db/ConnectionTest.php @@ -75,9 +75,4 @@ class ConnectionTest extends \yiiunit\MysqlTestCase $this->assertEquals('{{column}}', $connection->quoteColumnName('{{column}}')); $this->assertEquals('(column)', $connection->quoteColumnName('(column)')); } - - function testAttribute() - { - - } }