diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-19 08:18:35 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-19 08:18:35 +0000 |
commit | 1ec9a7b7a6ae3801e7cd0147519aa04be992ad8a (patch) | |
tree | d9c2bd295d0a17575da8289142965fa4f6d84d5e | |
parent | 8fc581d4d70ad4554a574d6338c96b744195a25a (diff) | |
download | brdo-1ec9a7b7a6ae3801e7cd0147519aa04be992ad8a.tar.gz brdo-1ec9a7b7a6ae3801e7cd0147519aa04be992ad8a.tar.bz2 |
- Patch #298309 by mfer: add PDO::FETCH_PROPS_LATE to tell __construct() to run before properties are added to the object. This is closer to the expected behavior and avoids that values are being overwritten.
-rw-r--r-- | includes/database/database.inc | 3 |
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']); |