mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #917 from TheFrozenFire/feature-DataObjectFromStdClass
API: DataObject::__construct() now accepts stdClass for $record
This commit is contained in:
commit
d8c920285c
@ -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'";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user