xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Manager
  • Zone

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
Extended by Core\Set implements Core\Accessor
Extended by Core\Plugin\Zone
Namespace: Core\Plugin
Package: Core\Plugin
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at Plugin/Zone.inc.php

Methods summary

public
# __construct( string $name )

Initialises a new zone.

Initialises a new zone.

Parameters

$name
Name of zone.

Since

3.1
protected
# _load( )

Establishes deferred plugin connections by invoking the Core\Plugin\Plugin::onZoneLoad() callbacks.

Establishes deferred plugin connections by invoking the Core\Plugin\Plugin::onZoneLoad() callbacks.

Since

3.1
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.

Adds a new listener for a given callback name. If an equal listener already exists, it is registered again.

Parameters

$name

Name of the callback to register listener for. Callback names are case-sensitive.

$objectOrCallable

Either a callable or an object or class name that combined with the method name argument forms a callable.

$methodName

Name of method if first argument is an object or class name. If the first parameter is an object or class name but not callable on it's own and no method name is given, the method name is created from the name of the callback with the prefix "on".

Returns


$this

See

Delegate::add()

Since

3.1
public mixed
# invoke( string $callbackName, array $arguments = null, callable $invocationCallback = null )

Invokes a callback on all plugins registered for the zone and callback name.

Invokes a callback on all plugins registered for the zone and callback name.

Parameters

$callbackName
Name of callback to invoke.
$arguments
Array of arguments passed on to invoked plugin methods.
$invocationCallback

Optional callback to process the result value of each invoked plugin method. See Core\Plugin\Delegate::invokeWithArguments() for details on the invocation callback.

Returns

mixed

Return value of last invoked plugin callback method or, if given, the invocation callback function outcome. Should generally be a Boolean value. If no plugin has registered itself for the callback, the return value is null.

Remark

Zones use deferred loading. If this is the first callback invocation for the zone, the zone will initialise first and let each plugin register all callbacks for the zone.


See

Plugin\Manager::invoke()

Since

3.1
public
# registerPlugin( Core\Plugin $plugin )

Registers a plugin for this zone. Only registered plugins receive zone load callbacks to register listeners.

Registers a plugin for this zone. Only registered plugins receive zone load callbacks to register listeners.

Parameters

$plugin
Plugin to register.

Event

Invokes the Zone.Load callback on the registered plugin. The callback may be deferred until a zone callback is invoked for the first time.


Since

3.1
public
# unregisterPlugin( Core\Plugin $plugin )

Removes a plugin from the list of registered plugins.

Removes a plugin from the list of registered plugins.

Parameters

$plugin
Plugin to un-register.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

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 Core\Delegate[] $_v_delegates

Associative array of delegate names and instances registered in the zone.

Associative array of delegate names and instances registered in the zone.

Since

3.1
# array ()
protected boolean $_v_isLoaded

Flag whether the zone has been loaded (that is, whether plugin connections were established).

Flag whether the zone has been loaded (that is, whether plugin connections were established).

Since

3.1
# false
protected string $_v_name

Zone name.

Zone name.

Since

3.1
#
protected Core\Plugin[] $_v_plugins

Array of plugins registered for this zone.

Array of plugins registered for this zone.

Since

3.1
# array ()

Magic properties

public read-only boolean $isLoaded

Flag whether the zone has been loaded.

public read-only string $name

Zone name.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen