Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
5df51cb3
Unverified
Commit
5df51cb3
authored
May 27, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved rowCount() from Statement to ResultStatement
parent
72e219a7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
13 deletions
+29
-13
UPGRADE.md
UPGRADE.md
+4
-0
ArrayStatement.php
src/Cache/ArrayStatement.php
+9
-0
ResultCacheStatement.php
src/Cache/ResultCacheStatement.php
+5
-0
ResultStatement.php
src/Driver/ResultStatement.php
+11
-0
Statement.php
src/Driver/Statement.php
+0
-13
No files found.
UPGRADE.md
View file @
5df51cb3
# Upgrade to 3.0
## BC BREAK `Statement::rowCount()` is moved.
`Statement::rowCount()`
has been moved to the
`ResultStatement`
interface where it belongs by definition.
## Removed `FetchMode` and the corresponding methods
1.
The
`FetchMode`
class and the
`setFetchMode()`
method of the
`Connection`
and
`Statement`
interfaces are removed.
...
...
src/Cache/ArrayStatement.php
View file @
5df51cb3
...
...
@@ -50,6 +50,15 @@ class ArrayStatement implements ResultStatement
return
$this
->
columnCount
;
}
public
function
rowCount
()
:
int
{
if
(
$this
->
data
===
null
)
{
return
0
;
}
return
count
(
$this
->
data
);
}
/**
* {@inheritdoc}
*/
...
...
src/Cache/ResultCacheStatement.php
View file @
5df51cb3
...
...
@@ -94,6 +94,11 @@ class ResultCacheStatement implements ResultStatement
return
$this
->
statement
->
columnCount
();
}
public
function
rowCount
()
:
int
{
return
$this
->
statement
->
rowCount
();
}
/**
* {@inheritdoc}
*/
...
...
src/Driver/ResultStatement.php
View file @
5df51cb3
...
...
@@ -25,6 +25,17 @@ interface ResultStatement
*/
public
function
columnCount
();
/**
* Returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
* executed by the corresponding object.
*
* If the last SQL statement executed by the associated Statement object was a SELECT statement,
* some databases may return the number of rows returned by that statement. However,
* this behaviour is not guaranteed for all databases and should not be
* relied on for portable applications.
*/
public
function
rowCount
()
:
int
;
/**
* Returns the next row of a result set as a numeric array or FALSE if there are no more rows.
*
...
...
src/Driver/Statement.php
View file @
5df51cb3
...
...
@@ -72,17 +72,4 @@ interface Statement extends ResultStatement
* @return bool TRUE on success or FALSE on failure.
*/
public
function
execute
(
$params
=
null
);
/**
* Returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
* executed by the corresponding object.
*
* If the last SQL statement executed by the associated Statement object was a SELECT statement,
* some databases may return the number of rows returned by that statement. However,
* this behaviour is not guaranteed for all databases and should not be
* relied on for portable applications.
*
* @return int The number of rows.
*/
public
function
rowCount
()
:
int
;
}
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