Interestingly enough, when you use fetchAll, the constructor for your object is called AFTER the properties are assigned. For example:
<?php
class person {
public $name;
function __construct() {
$this->name = $this->name . " is my name.";
}
}
$obj = $STH->fetchALL(PDO::FETCH_CLASS, 'person');
?>
Will result in ' is my name' being appended to all the name columns. However if you call it slightly differently:
<?php
$obj = $obj = $STH->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'person');
?>
Then the constructor will be called before properties are assigned. I can't find this documented anywhere, so I thought it would be nice to add a note here.