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
4267b53d
Commit
4267b53d
authored
Jan 14, 2015
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added doc about count() return value
fixes #yiisoft/yii#3712
parent
4ae7eb18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Query.php
framework/db/Query.php
+3
-2
QueryInterface.php
framework/db/QueryInterface.php
+1
-1
No files found.
framework/db/Query.php
View file @
4267b53d
...
@@ -273,7 +273,8 @@ class Query extends Component implements QueryInterface
...
@@ -273,7 +273,8 @@ class Query extends Component implements QueryInterface
* Make sure you properly quote column names in the expression.
* Make sure you properly quote column names in the expression.
* @param Connection $db the database connection used to generate the SQL statement.
* @param Connection $db the database connection used to generate the SQL statement.
* If this parameter is not given (or null), the `db` application component will be used.
* If this parameter is not given (or null), the `db` application component will be used.
* @return integer number of records
* @return integer|string number of records. The result may be a string depending on the
* underlying database engine and to support integer values higher than a 32bit PHP integer can handle.
*/
*/
public
function
count
(
$q
=
'*'
,
$db
=
null
)
public
function
count
(
$q
=
'*'
,
$db
=
null
)
{
{
...
@@ -286,7 +287,7 @@ class Query extends Component implements QueryInterface
...
@@ -286,7 +287,7 @@ class Query extends Component implements QueryInterface
* Make sure you properly quote column names in the expression.
* Make sure you properly quote column names in the expression.
* @param Connection $db the database connection used to generate the SQL statement.
* @param Connection $db the database connection used to generate the SQL statement.
* If this parameter is not given, the `db` application component will be used.
* If this parameter is not given, the `db` application component will be used.
* @return mixed the sum of the specified column values
* @return mixed the sum of the specified column values
.
*/
*/
public
function
sum
(
$q
,
$db
=
null
)
public
function
sum
(
$q
,
$db
=
null
)
{
{
...
...
framework/db/QueryInterface.php
View file @
4267b53d
...
@@ -44,7 +44,7 @@ interface QueryInterface
...
@@ -44,7 +44,7 @@ interface QueryInterface
* @param string $q the COUNT expression. Defaults to '*'.
* @param string $q the COUNT expression. Defaults to '*'.
* @param Connection $db the database connection used to execute the query.
* @param Connection $db the database connection used to execute the query.
* If this parameter is not given, the `db` application component will be used.
* If this parameter is not given, the `db` application component will be used.
* @return integer number of records
* @return integer number of records
.
*/
*/
public
function
count
(
$q
=
'*'
,
$db
=
null
);
public
function
count
(
$q
=
'*'
,
$db
=
null
);
...
...
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