Issue #1854752 by Gábor Hojtsy, chx, amateescu: re-Add PDO::FETCH_PROPS_LATE to PDO::FETCH_CLASS.

8.0.x
Dries 2013-03-22 13:15:31 -04:00
parent 61de42a008
commit eb4759d90b
1 changed files with 3 additions and 4 deletions

View File

@ -40,10 +40,9 @@ class Statement extends PDOStatement implements StatementInterface {
public function execute($args = array(), $options = array()) {
if (isset($options['fetch'])) {
if (is_string($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']);
// 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']);