summaryrefslogtreecommitdiff
path: root/includes/database/database.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r--includes/database/database.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index ed479fe5a..0369b34b0 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -1007,7 +1007,8 @@ class DatabaseStatement extends PDOStatement {
public function execute($args, $options) {
if (isset($options['fetch'])) {
if (is_string($options['fetch'])) {
- $this->setFetchMode(PDO::FETCH_CLASS, $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']);
}
else {
$this->setFetchMode($options['fetch']);