Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
9958a580
Commit
9958a580
authored
Jan 17, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB cleanup
parent
9b62fb67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
49 deletions
+13
-49
ActiveQuery.php
framework/db/ActiveQuery.php
+3
-3
Query.php
framework/db/Query.php
+10
-9
CommandTest.php
tests/unit/framework/db/CommandTest.php
+0
-32
ConnectionTest.php
tests/unit/framework/db/ConnectionTest.php
+0
-5
No files found.
framework/db/ActiveQuery.php
View file @
9958a580
...
@@ -34,9 +34,9 @@ use yii\db\Exception;
...
@@ -34,9 +34,9 @@ use yii\db\Exception;
*
*
* ActiveQuery also provides the following additional query options:
* ActiveQuery also provides the following additional query options:
*
*
* - [[with]]: list of relations that this query should be performed with.
* - [[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.
* - [[indexBy
()
]]: the name of the column by which the query result should be indexed.
* - [[asArray]]: whether to return each record as an array.
* - [[asArray
()
]]: whether to return each record as an array.
*
*
* These options can be configured using methods of the same name. For example:
* These options can be configured using methods of the same name. For example:
*
*
...
...
framework/db/Query.php
View file @
9958a580
...
@@ -10,13 +10,15 @@
...
@@ -10,13 +10,15 @@
namespace
yii\db
;
namespace
yii\db
;
/**
/**
* Query represents a SQL statement in a way that is independent of DBMS.
* Query represents a S
ELECT S
QL statement in a way that is independent of DBMS.
*
*
* Query
not only can represent a SELECT statement, it can also represent INSERT, UPDATE, DELETE,
* Query
provides a set of methods to facilitate the specification of different clauses
*
and other commonly used DDL statements, such as CREATE TABLE, CREATE INDEX, etc
.
*
in a SELECT statement. These methods can be chained together
.
*
*
* Query provides a set of methods to facilitate the specification of different clauses.
* By calling [[createCommand()]], we can get a [[Command]] instance which can be further
* These methods can be chained together. For example,
* used to perform/execute the DB query against a database.
*
* For example,
*
*
* ~~~
* ~~~
* $query = new Query;
* $query = new Query;
...
@@ -24,12 +26,11 @@ namespace yii\db;
...
@@ -24,12 +26,11 @@ namespace yii\db;
* ->from('tbl_user')
* ->from('tbl_user')
* ->limit(10);
* ->limit(10);
* // build and execute the query
* // 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 <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
...
...
tests/unit/framework/db/CommandTest.php
View file @
9958a580
...
@@ -223,7 +223,6 @@ class CommandTest extends \yiiunit\MysqlTestCase
...
@@ -223,7 +223,6 @@ class CommandTest extends \yiiunit\MysqlTestCase
$this
->
assertTrue
(
is_array
(
$result
)
&&
isset
(
$result
[
0
]));
$this
->
assertTrue
(
is_array
(
$result
)
&&
isset
(
$result
[
0
]));
}
}
function
testInsert
()
function
testInsert
()
{
{
...
@@ -298,34 +297,4 @@ class CommandTest extends \yiiunit\MysqlTestCase
...
@@ -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
tests/unit/framework/db/ConnectionTest.php
View file @
9958a580
...
@@ -75,9 +75,4 @@ class ConnectionTest extends \yiiunit\MysqlTestCase
...
@@ -75,9 +75,4 @@ class ConnectionTest extends \yiiunit\MysqlTestCase
$this
->
assertEquals
(
'{{column}}'
,
$connection
->
quoteColumnName
(
'{{column}}'
));
$this
->
assertEquals
(
'{{column}}'
,
$connection
->
quoteColumnName
(
'{{column}}'
));
$this
->
assertEquals
(
'(column)'
,
$connection
->
quoteColumnName
(
'(column)'
));
$this
->
assertEquals
(
'(column)'
,
$connection
->
quoteColumnName
(
'(column)'
));
}
}
function
testAttribute
()
{
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment