class SimpleActiveRecord in Rotating Banner 7.2
Same name and namespace in other branches
- 7 rotating_banner.classes.inc \SimpleActiveRecord
Hierarchy
- class \SimpleActiveRecord
Expanded class hierarchy of SimpleActiveRecord
File
- ./
rotating_banner.classes.inc, line 258
View source
class SimpleActiveRecord {
public function setValuesFromArray($array) {
foreach ($this
->dbFields() as $field_name) {
if (isset($array[$field_name])) {
$this->{$field_name} = $array[$field_name];
}
}
}
/**
* Disclaimer: This is a hack. The PDO::FETCH_CLASS does not behave as
* documented. It is supposed to run the constructor *after* the properties
* have been assigned and in some versions of PHP, it does that.
*
* However, as of http://bugs.php.net/bug.php?id=46292, it does not. This method
* receives a list of Objects and runs a ->initialize() method on them. This
* is basically another constructor which can be run afterwards.
*/
public static function runInitialize(&$result) {
foreach ($result as &$row) {
$row
->initialize();
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimpleActiveRecord:: |
public static | function | Disclaimer: This is a hack. The PDO::FETCH_CLASS does not behave as documented. It is supposed to run the constructor *after* the properties have been assigned and in some versions of PHP, it does that. | |
SimpleActiveRecord:: |
public | function |