Class ComponentContainer (namespace Nette)


ComponentContainer is default implementation of IComponentContainer.

Object
   |
   --Component
      |
      --ComponentContainer

Implements interfaces:

Direct Known Sub-classes:

Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /ComponentContainer.php (line 23)
Public Method Summary
void
addComponent (IComponent $component, string $name, [string $insertBefore = NULL])
Adds the specified component to the IComponentContainer.
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.
void
removeComponent (IComponent $component)
Removes a component from the IComponentContainer.
void
__clone ()
Object cloning.
Protected Method Summary
protected IComponent
createComponent (string $name)
Component factory. Delegates the creation of components to a createComponent<Name> method.
protected void
Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()

Method Details

line 45

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 172

createComponent

protected IComponent createComponent (string $name)

Component factory. Delegates the creation of components to a createComponent<Name> method.

Input
string $name component name
Output
IComponent the created component (optionally)

line 122

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 189

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 103

removeComponent

public void removeComponent (IComponent $component)

Removes a component from the IComponentContainer.

Input
IComponent $component
Output
void  

line 211

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 224

__clone

public void __clone ()

Object cloning.

Overridden in child classes as:

Output
void