/** * Gets and registers a new reference. * * @param t3lib_utility_Dependency_Element $element * @param string $field * @return t3lib_utility_Dependency_Reference */ public function getReference(t3lib_utility_Dependency_Element $element, $field) { $referenceName = $element->__toString() . '.' . $field; if (!isset($this->references[$referenceName][$field])) { $this->references[$referenceName][$field] = t3lib_div::makeInstance('t3lib_utility_Dependency_Reference', $element, $field); } return $this->references[$referenceName][$field]; }
/** * Gets all nested elements (including the parent) of a particular outermost parent element. * * @throws RuntimeException * @param t3lib_utility_Dependency_Element $outerMostParent * @return array */ public function getNestedElements(t3lib_utility_Dependency_Element $outerMostParent) { $outerMostParentName = $outerMostParent->__toString(); if (!isset($this->outerMostParents[$outerMostParentName])) { throw new RuntimeException('Element "' . $outerMostParentName . '" was detected as outermost parent.', 1289318609); } $nestedStructure = array_merge(array($outerMostParentName => $outerMostParent), $outerMostParent->getNestedChildren()); return $nestedStructure; }