mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: fix to #110845 to allow parsing of the DataObject file in PHP 5.2 and below.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@110863 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ed666b71b7
commit
c32a6e34a0
@ -408,13 +408,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
// DO NOT copy has_many relations, because copying the relation would result in us changing the has_one relation
|
// DO NOT copy has_many relations, because copying the relation would result in us changing the has_one relation
|
||||||
// on the other side of this relation to point at the copy and no longer the original (being a has_one, it can
|
// on the other side of this relation to point at the copy and no longer the original (being a has_one, it can
|
||||||
// only point at one thing at a time). So, all relations except has_many can and are copied
|
// only point at one thing at a time). So, all relations except has_many can and are copied
|
||||||
if ($sourceObject::$has_one) foreach($sourceObject::$has_one as $name => $type) {
|
if ($sourceObject->has_one()) foreach($sourceObject->has_one() as $name => $type) {
|
||||||
$this->duplicateRelations($sourceObject, $destinationObject, $name);
|
$this->duplicateRelations($sourceObject, $destinationObject, $name);
|
||||||
}
|
}
|
||||||
if ($sourceObject::$many_many) foreach($sourceObject::$many_many as $name => $type) {
|
if ($sourceObject->many_many()) foreach($sourceObject->many_many() as $name => $type) { //many_many include belongs_many_many
|
||||||
$this->duplicateRelations($sourceObject, $destinationObject, $name);
|
|
||||||
}
|
|
||||||
if ($sourceObject::$belongs_many_many) foreach($sourceObject::$belongs_many_many as $name => $type) {
|
|
||||||
$this->duplicateRelations($sourceObject, $destinationObject, $name);
|
$this->duplicateRelations($sourceObject, $destinationObject, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user