From b877ddb54693a4fdb03a14d97ad133b830ca4fbb Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 25 Nov 2008 03:34:33 +0000 Subject: [PATCH] Added support to DataObject::relObject() for looking at $casting to get information about the relation - good for dynamic relations git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66582 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObject.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/model/DataObject.php b/core/model/DataObject.php index b03efe7c2..e5a49031d 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -2020,6 +2020,8 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP $component = singleton($rel); } elseif ($rel = $component->many_many($relation)) { $component = singleton($rel[1]); + } elseif($info = $this->castingHelperPair($relation)) { + $component = singleton($info['className']); } }