diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-10-08 11:21:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-10-08 11:21:37 +0000 |
commit | d9e7191f22a214c72cb6080bd17e7c57466e4995 (patch) | |
tree | f9003366879f2e962c9debe3f7558a59b6c60d5a | |
parent | 3257718a0226e7d2dc6775a1aea0597deefe5342 (diff) | |
download | brdo-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.inc | 6 |
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']); |