summaryrefslogtreecommitdiff
path: root/includes/database
diff options
context:
space:
mode:
Diffstat (limited to 'includes/database')
-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']);