Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
4cd373bf
Commit
4cd373bf
authored
Jul 03, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#509122
by Berdir: rest in peace db_affected_rows().
parent
293ea4c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
29 deletions
+1
-29
includes/database/database.inc
includes/database/database.inc
+0
-26
includes/database/prefetch.inc
includes/database/prefetch.inc
+0
-1
modules/node/node.module
modules/node/node.module
+1
-2
No files found.
includes/database/database.inc
View file @
4cd373bf
...
...
@@ -183,16 +183,6 @@
*/
abstract
class
DatabaseConnection
extends
PDO
{
/**
* Reference to the last statement that was executed.
*
* We only need this for the legacy db_affected_rows() call, which will be removed.
*
* @var DatabaseStatementInterface
* @todo Remove this variable.
*/
public
$lastStatement
;
/**
* The database target this connection is for.
*
...
...
@@ -1681,7 +1671,6 @@ public function execute($args = array(), $options = array()) {
$this
->
setFetchMode
(
$options
[
'fetch'
]);
}
}
$this
->
dbh
->
lastStatement
=
$this
;
$logger
=
$this
->
dbh
->
getLogger
();
if
(
!
empty
(
$logger
))
{
...
...
@@ -2538,21 +2527,6 @@ function db_last_insert_id($table, $field) {
return
Database
::
getConnection
()
->
lastInsertId
(
$sequence_name
);
}
/**
* Determine the number of rows changed by the preceding query.
*
* This may not work, actually, without some tricky temp code.
*
* @todo Remove this function when all queries have been ported to db_update().
*/
function
db_affected_rows
()
{
$statement
=
Database
::
getConnection
()
->
lastStatement
;
if
(
!
$statement
)
{
return
0
;
}
return
$statement
->
rowCount
();
}
/**
* Helper function for db_rewrite_sql.
*
...
...
includes/database/prefetch.inc
View file @
4cd373bf
...
...
@@ -154,7 +154,6 @@ public function execute($args = array(), $options = array()) {
$this
->
setFetchMode
(
$options
[
'fetch'
]);
}
}
$this
->
dbh
->
lastStatement
=
$this
;
$logger
=
$this
->
dbh
->
getLogger
();
if
(
!
empty
(
$logger
))
{
...
...
modules/node/node.module
View file @
4cd373bf
...
...
@@ -522,11 +522,10 @@ function node_type_delete($type) {
* The number of nodes whose node type field was modified.
*/
function
node_type_update_nodes
(
$old_type
,
$type
)
{
db_update
(
'node'
)
return
db_update
(
'node'
)
->
fields
(
array
(
'type'
=>
$type
))
->
condition
(
'type'
,
$old_type
)
->
execute
();
return
db_affected_rows
();
}
/**
...
...
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