summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-10-08 11:21:37 +0000
committerDries Buytaert <dries@buytaert.net>2008-10-08 11:21:37 +0000
commitd9e7191f22a214c72cb6080bd17e7c57466e4995 (patch)
treef9003366879f2e962c9debe3f7558a59b6c60d5a
parent3257718a0226e7d2dc6775a1aea0597deefe5342 (diff)
downloadbrdo-d9e7191f22a214c72cb6080bd17e7c57466e4995.tar.gz
brdo-d9e7191f22a214c72cb6080bd17e7c57466e4995.tar.bz2
- Patch #310904 by mfer, Crell et al: use early fetch and document why.
-rw-r--r--includes/database/database.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index 6bd5b2d7e..f0525e800 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -1047,8 +1047,10 @@ class DatabaseStatement extends PDOStatement {
public function execute($args, $options) {
if (isset($options['fetch'])) {
if (is_string($options['fetch'])) {
- // PDO::FETCH_PROPS_LATE tells __construct() to run before properties are added to the object.
- $this->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, $options['fetch']);
+ // Default to an object. Note: db fields will be added to the object
+ // before the constructor is run. If you need to assign fields after
+ // the constructor is run, see http://drupal.org/node/315092.
+ $this->setFetchMode(PDO::FETCH_CLASS, $options['fetch']);
}
else {
$this->setFetchMode($options['fetch']);