Generator/Collection/ComponentCollection.php
public function getClosestRequestingRootComponent(BaseGenerator $component) {
    if ($this->getComponentKey($component) === $this->rootGeneratorId) {
      throw new \LogicException("ComponentCollection::getClosestRequestingRootComponent() may not be called with the root component.");
    }

    $component_id = $this->getComponentKey($component);

    $closest_requesting_root_id = $this->requestRoots[$component_id];
    return $this->components[$closest_requesting_root_id];
  }
public function getClosestRequestingRootComponent(BaseGenerator $component) {
    if ($this->getComponentKey($component) === $this->rootGeneratorId) {
      throw new \LogicException("ComponentCollection::getClosestRequestingRootComponent() may not be called with the root component.");
    }

    $component_id = $this->getComponentKey($component);

    $closest_requesting_root_id = $this->requestRoots[$component_id];
    return $this->components[$closest_requesting_root_id];
  }
public function getClosestRequestingRootComponent ( BaseGenerator $ component ) { if ( $ this -> getComponentKey ( $ component ) === $ this -> rootGeneratorId ) { throw new \ LogicException ( "ComponentCollection::getClosestRequestingRootComponent() may not be called with the root component." ) ; } $ component_id = $ this -> getComponentKey ( $ component ) ; $ closest_requesting_root_id = $ this -> requestRoots [ $ component_id ] ; return $ this -> components [ $ closest_requesting_root_id ] ; }
Returns the closest requester that is a root component.

This may be called before the collection is complete.

@param BaseGenerator $component
The component to get children for.

@return
The root component.

@throws \LogicException
Throws an exception if called with the root component, as in that case
the answer does not make sense.
Returns the closest requester that is a root component .