Пример #1
0
 /**
  * Removes a component from the IComponentContainer.
  * @param  IComponent
  * @return void
  */
 public function removeComponent(IComponent $component)
 {
     $name = $component->getName();
     if (!isset($this->components[$name]) || $this->components[$name] !== $component) {
         throw new InvalidArgumentException("Component named '{$name}' is not located in this container.");
     }
     unset($this->components[$name]);
     $component->setParent(NULL);
 }