Class ComponentContainer (namespace Nette)


ComponentContainer is default implementation of IComponentContainer.

Object
   |
   --Component
      |
      --ComponentContainer

Implements interfaces:

IComponentContainer

Direct Known Sub-classes:

PresenterComponent, FormContainer
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /ComponentContainer.php (line 38)
Method Summary
void
addComponent (IComponent $component, string $name, [string $insertBefore = NULL])
Adds the specified component to the IComponentContainer.
protected void
createComponent (string $name)
Component factory. Descendant can override this method to enable lazy component loading.
IComponent|NULL
getComponent (string $name, [bool $need = TRUE])
Returns component specified by name or path.
ArrayIterator
getComponents ([bool $deep = FALSE], [string $filterType = NULL])
Iterates over a components.
NULL|IComponent
Is container cloning now?
void
removeComponent (IComponent $component)
Removes a component from the IComponentContainer.
protected void
Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
void
__clone ()
Object cloning.
Methods Inherited From Component
Component::__construct(), Component::attached(), Component::detached(), Component::getName(), Component::getParent(), Component::getService(), Component::getServiceLocator(), Component::lookup(), Component::lookupPath(), Component::monitor(), Component::setParent(), Component::setServiceLocator(), Component::validateParent(), Component::__clone(), Component::__wakeup()
Methods Inherited From Object
Object::extensionMethod(), Object::getClass(), Object::getReflection(), Object::__call(), Object::__callStatic(), Object::__get(), Object::__isset(), Object::__set(), Object::__unset()

Method Details

line 60

addComponent

public void addComponent (IComponent $component, string $name, [string $insertBefore = NULL])

Adds the specified component to the IComponentContainer.

Overridden in child classes as:

Input
IComponent $component
string $name
string $insertBefore
Output
void  
Throws
throws InvalidStateException

line 167

createComponent

protected void createComponent (string $name)

Component factory. Descendant can override this method to enable lazy component loading.

Input
string $name component name
Output
void  

line 137

getComponent

public IComponent|NULL getComponent (string $name, [bool $need = TRUE])

Returns component specified by name or path.

Input
string $name
bool $need throw exception if component doesn't exist?
Output
IComponent|NULL  

line 179

getComponents

public ArrayIterator getComponents ([bool $deep = FALSE], [string $filterType = NULL])

Iterates over a components.

Input
bool $deep recursive?
string $filterType class types filter
Output
ArrayIterator  

line 233

isCloning

public NULL|IComponent isCloning ()

Is container cloning now?

Output
NULL|IComponent  

line 118

removeComponent

public void removeComponent (IComponent $component)

Removes a component from the IComponentContainer.

Input
IComponent $component
Output
void  

line 200

validateChildComponent

protected void validateChildComponent (IComponent $child)

Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.

Input
IComponent $child
Output
void  
Throws
throws InvalidStateException

line 213

__clone

public void __clone ()

Object cloning.

Output
void