Commit d9e7191f authored by Dries's avatar Dries

- Patch #310904 by mfer, Crell et al: use early fetch and document why.

parent 3257718a
......@@ -1047,8 +1047,10 @@ protected function __construct($dbh) {
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
$this->setFetchMode(PDO::FETCH_CLASS, $options['fetch']);
else {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment