/** * 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]; }
/** * Transforms dependent elements to use the liveId as array key. * * @param array $elements Depedent elements, each of type t3lib_utility_Dependency_Element * @return array */ protected function transformDependentElementsToUseLiveId(array $elements) { $transformedElements = array(); /** @var $element t3lib_utility_Dependency_Element */ foreach ($elements as $element) { $elementName = t3lib_utility_Dependency_Element::getIdentifier($element->getTable(), $element->getDataValue('liveId')); $transformedElements[$elementName] = $element; } return $transformedElements; }
/** * 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; }