Class Component (namespace Nette)


Component is the base class for all components.

Components are objects implementing IComponent. They has parent component and own name.

Object
   |
   --Component

Implements interfaces:

Direct Known Sub-classes:

Copyright: Copyright (c) 2004, 2010 David Grudl
Abstract:
Located: in /Component.php (line 26)
Public Method Summary
Component
__construct ([IComponentContainer $parent = NULL], [$name = NULL])
string
getName ()
IComponentContainer|NULL
Returns the container if any.
IComponent
lookup (string $type, [bool $need = TRUE])
Lookup hierarchy for component specified by class or interface name.
string
lookupPath (string $type, [bool $need = TRUE])
Lookup for component specified by class or interface name. Returns backtrace path.
void
monitor (string $type)
Starts monitoring.
Component
setParent ([IComponentContainer $parent = NULL], [string $name = NULL])
Sets the parent of this component. This method is managed by containers and should.
void
unmonitor (string $type)
Stops monitoring.
void
__clone ()
Object cloning.
void
Prevents unserialization.
Protected Method Summary
protected void
This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
protected void
This method will be called before the component (or component's parent) becomes detached from a monitored object. Do not call this method yourself.
protected void
Is called by a component when it is about to be set new parent. Descendant can
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()

Method Details

line 41

__construct

public Component __construct ([IComponentContainer $parent = NULL], [$name = NULL])

Input
IComponentContainer $parent
$name
Output
Component  

line 145

attached

protected void attached (IComponent $obj)

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.

Input
IComponent $obj
Output
void  

line 157

detached

protected void detached (IComponent $obj)

This method will be called before the component (or component's parent) becomes detached from a monitored object. Do not call this method yourself.

Input
IComponent $obj
Output
void  

line 170

getName

public string getName ()

Implementation of:

Output
string  

line 181

getParent

public IComponentContainer|NULL getParent ()

Returns the container if any.

Implementation of:

Output
IComponentContainer|NULL  

line 59

lookup

public IComponent lookup (string $type, [bool $need = TRUE])

Lookup hierarchy for component specified by class or interface name.

Input
string $type class/interface type
bool $need throw exception if component doesn't exist?
Output
IComponent  

line 99

lookupPath

public string lookupPath (string $type, [bool $need = TRUE])

Lookup for component specified by class or interface name. Returns backtrace path.

A path is the concatenation of component names separated by self::NAME_SEPARATOR.

Input
string $type class/interface type
bool $need throw exception if component doesn't exist?
Output
string  

line 113

monitor

public void monitor (string $type)

Starts monitoring.

Input
string $type class/interface type
Output
void  

line 197

setParent

public Component setParent ([IComponentContainer $parent = NULL], [string $name = NULL])

Sets the parent of this component. This method is managed by containers and should.

not be called by applications

Implementation of:

Input
IComponentContainer $parent New parent or null if this component is being removed from a parent
string $name
Output
Component provides a fluent interface
Throws
throws InvalidStateException

line 131

unmonitor

public void unmonitor (string $type)

Stops monitoring.

Input
string $type class/interface type
Output
void  

line 237

validateParent

protected void validateParent (IComponentContainer $parent)

Is called by a component when it is about to be set new parent. Descendant can

override this method to disallow a parent change by throwing an \InvalidStateException

Input
IComponentContainer $parent
Output
void  
Throws
throws InvalidStateException

line 312

__clone

public void __clone ()

Object cloning.

Overridden in child classes as:

Output
void  

line 334

__wakeup

public void __wakeup ()

Prevents unserialization.

Output
void