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
This commit is contained in:
Sam Minnee 2008-11-25 03:34:33 +00:00
parent 916df369d8
commit b877ddb546

View File

@ -2020,6 +2020,8 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
$component = singleton($rel); $component = singleton($rel);
} elseif ($rel = $component->many_many($relation)) { } elseif ($rel = $component->many_many($relation)) {
$component = singleton($rel[1]); $component = singleton($rel[1]);
} elseif($info = $this->castingHelperPair($relation)) {
$component = singleton($info['className']);
} }
} }