PHP Class Nette\ComponentModel\Component

Components are objects implementing IComponent. They has parent component and own name.
Author: David Grudl
Inheritance: extends Nette\Object, implements Nette\ComponentModel\IComponent
Datei anzeigen Open project: nette/component-model Class Usage Examples

Public Methods

Method Description
__clone ( ) Object cloning.
__construct ( )
__sleep ( ) Prevents serialization.
__wakeup ( ) Prevents unserialization.
getName ( ) : string
getParent ( ) : Nette\ComponentModel\IContainer | null Returns the container if any.
lookup ( $type, $need = TRUE ) : Nette\ComponentModel\IComponent Lookup hierarchy for component specified by class or interface name.
lookupPath ( $type = NULL, $need = TRUE ) : string Lookup for component specified by class or interface name. Returns backtrace path.
monitor ( $type ) : void Starts monitoring.
setParent ( Nette\ComponentModel\IContainer $parent = NULL, $name = NULL ) : self Sets the parent of this component. This method is managed by containers and should not be called by applications
unmonitor ( $type ) : void Stops monitoring.

Protected Methods

Method Description
attached ( $obj ) : 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.
detached ( $obj ) : 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.
validateParent ( Nette\ComponentModel\IContainer $parent ) : void 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 Nette\InvalidStateException

Private Methods

Method Description
refreshMonitors ( $depth, &$missing = NULL, &$listeners = [] ) : void Refreshes monitors.

Method Details

__clone() public method

Object cloning.
public __clone ( )

__construct() public method

public __construct ( )

__sleep() public method

Prevents serialization.
public __sleep ( )

__wakeup() public method

Prevents unserialization.
public __wakeup ( )

attached() protected method

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 attached ( $obj ) : void
return void

detached() protected method

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 detached ( $obj ) : void
return void

getName() public method

public getName ( ) : string
return string

getParent() public method

Returns the container if any.
public getParent ( ) : Nette\ComponentModel\IContainer | null
return Nette\ComponentModel\IContainer | null

lookup() public method

Lookup hierarchy for component specified by class or interface name.
public lookup ( $type, $need = TRUE ) : Nette\ComponentModel\IComponent
return Nette\ComponentModel\IComponent

lookupPath() public method

A path is the concatenation of component names separated by self::NAME_SEPARATOR.
public lookupPath ( $type = NULL, $need = TRUE ) : string
return string

monitor() public method

Starts monitoring.
public monitor ( $type ) : void
return void

setParent() public method

Sets the parent of this component. This method is managed by containers and should not be called by applications
public setParent ( Nette\ComponentModel\IContainer $parent = NULL, $name = NULL ) : self
$parent Nette\ComponentModel\IContainer
return self

unmonitor() public method

Stops monitoring.
public unmonitor ( $type ) : void
return void

validateParent() protected method

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 Nette\InvalidStateException
protected validateParent ( Nette\ComponentModel\IContainer $parent ) : void
$parent Nette\ComponentModel\IContainer
return void