Merge pull request #917 from TheFrozenFire/feature-DataObjectFromStdClass

API: DataObject::__construct() now accepts stdClass for $record
This commit is contained in:
Simon Welsh 2012-11-03 02:16:07 -07:00
commit d8c920285c

View File

@ -323,7 +323,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
);
}
if(!is_array($record)) {
if(!is_array($record) && !is_a($record, "stdClass")) {
if(is_object($record)) $passed = "an object of type '$record->class'";
else $passed = "The value '$record'";