Class NComponent
NComponent is the base class for all components.
Components are objects implementing IComponent. They has parent component and own name.
- NObject
-
NComponent implements IComponent
public
|
#
__construct(
IComponentContainer
$parent = NULL,
$name = NULL
)
|
public
IComponent
|
#
lookup(
string
$type,
bool
$need = true
)
Lookup hierarchy for component specified by class or interface name. Lookup hierarchy for component specified by class or interface name. Parameters$type string class/interface type$need bool throw exception if component doesn't exist? |
public
string
|
#
lookupPath(
string
$type,
bool
$need = true
)
Lookup for component specified by class or interface name. Returns backtrace path. 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. Parameters$type string class/interface type$need bool throw exception if component doesn't exist? |
public
void
|
#
monitor(
string
$type
)
Starts monitoring. Starts monitoring. Parameters$type string class/interface type |
public
void
|
#
unmonitor(
string
$type
)
Stops monitoring. Stops monitoring. Parameters$type string class/interface type |
protected
void
|
#
attached(
IComponent
$obj
)
This method will be called when the component (or component's parent) This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself. Parameters$obj IComponent |
protected
void
|
#
detached(
IComponent
$obj
)
This method will be called before the component (or component's parent) This method will be called before the component (or component's parent) becomes detached from a monitored object. Do not call this method yourself. Parameters$obj IComponent |
final public
string
|
#
getName(
)
Implementation of |
final public
IComponentContainer|NULL
|
#
getParent(
)
Returns the container if any. |
public
NComponent
|
#
setParent(
IComponentContainer
$parent = NULL,
string
$name = NULL
)
Sets the parent of this component. This method is managed by containers and should. Sets the parent of this component. This method is managed by containers and should. not be called by applications Parameters$parent IComponentContainer New parent or null if this component is being removed from a parent$name stringReturnsNComponent provides a fluent interface
ThrowsImplementation of |
protected
void
|
#
validateParent(
IComponentContainer
$parent
)
Is called by a component when it is about to be set new parent. Descendant can 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 Parameters$parent IComponentContainerThrows |
public
|
#
__clone(
)
NObject cloning. NObject cloning. |
final public
|
#
__wakeup(
)
Prevents unserialization. Prevents unserialization. |
Methods Inherited From NObject
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
NAME_SEPARATOR |
'-' # |