Class Zone
A plugin zone represents a namespace or application category that provides plugin callbacks. Plugins are on load registered to a list of zones that is provided by them; they remain dormant until a zone becomes active.
Once a zone is loaded, plugins register their actual callback listeners. If a callback is invoked by an application, the zone delegates the call to all registered plugin callbacks.
- Core\Object implements Core\Chainable
- Core\Set implements Core\Accessor
- Core\Plugin\Zone
Package: Core\Plugin
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at Plugin/Zone.inc.php
Methods summary
public
|
|
protected
|
#
_load( )
Establishes deferred plugin connections by invoking the Core\Plugin\Plugin::onZoneLoad() callbacks. |
public
|
#
add( string $name, mixed $objectOrCallable, string $methodName = null )
Adds a new listener for a given callback name. If an equal listener already exists, it is registered again. |
public
mixed
|
#
invoke( string $callbackName, array $arguments = null, callable $invocationCallback = null )
Invokes a callback on all plugins registered for the zone and callback name. |
public
|
#
registerPlugin(
Registers a plugin for this zone. Only registered plugins receive zone load callbacks to register listeners. |
public
|
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
__toString()
,
attachMethod()
,
chain()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
hash()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
protected
|
$_v_delegates
Associative array of delegate names and instances registered in the zone. |
#
array ()
|
protected
boolean
|
$_v_isLoaded
Flag whether the zone has been loaded (that is, whether plugin connections were established). |
#
false
|
protected
string
|
$_v_name
Zone name. |
|
protected
|
$_v_plugins
Array of plugins registered for this zone. |
#
array ()
|
Magic properties
public read-only
boolean
|
$isLoaded
Flag whether the zone has been loaded. |
public read-only
string
|
$name
Zone name. |