PHP Class ViMbAdmin_Controller_PluginAction

All application controlers subclass this rather than Zend's version directly.
Inheritance: extends ViMbAdmin_Controller_Action, implements OSS_Plugin_Observable
Datei anzeigen Open project: opensolutions/vimbadmin

Protected Properties

Property Type Description
$isEdit boolean Set by the add/edit actions, else null. Can be used by plugins to know if this is an add or edit operation.

Public Methods

Method Description
__construct ( Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = null ) Override the Zend_Controller_Action's constructor (which is called at the very beginning of this function anyway).
attach ( OSS_Plugin_Observer $observer ) Attach an instaniated observer
detach ( OSS_Plugin_Observer $observer ) Detach an observer
isEdit ( ) : boolean Getter method for isEdit
notify ( string $controller, string $action, string $hook, OSS_Controller_Action $controllerObject, object $params = null ) Give any observers a chance to execute their plugin code

Protected Methods

Method Description
loadObservers ( $path ) Loads any found plugin and instaniates it (unless disabled by configuration).
registerObservers ( ) Registers any plugins found in the main plugin directory as well as modules.

Method Details

__construct() public method

Override the Zend_Controller_Action's constructor (which is called at the very beginning of this function anyway).
public __construct ( Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = null )
$request Zend_Controller_Request_Abstract See Parent class constructor
$response Zend_Controller_Response_Abstract See Parent class constructor
$invokeArgs array See Parent class constructor

attach() public method

Attach an instaniated observer
public attach ( OSS_Plugin_Observer $observer )
$observer OSS_Plugin_Observer

detach() public method

Detach an observer
public detach ( OSS_Plugin_Observer $observer )
$observer OSS_Plugin_Observer

isEdit() public method

Getter method for isEdit
public isEdit ( ) : boolean
return boolean

loadObservers() protected method

Loads any found plugin and instaniates it (unless disabled by configuration).
protected loadObservers ( $path )

notify() public method

Give any observers a chance to execute their plugin code
public notify ( string $controller, string $action, string $hook, OSS_Controller_Action $controllerObject, object $params = null )
$controller string The controller name (e.g. 'mailbox', 'alias', etc
$action string The action name (e.g. 'add', 'edit', etc)
$hook string The name of the hook to add (e.g. 'preSave')
$controllerObject OSS_Controller_Action The controller object
$params object An optional anonymous object ( http://www.barryodonovan.com/index.php/2012/07/05/anonymous-objects-in-php )

registerObservers() protected method

FIXME This is 'autoload' functionality which can be expensive. Keep found plugin list in memcache? FIXME Ordering - allow option to specify desired plugins in config
protected registerObservers ( )

Property Details

$isEdit protected_oe property

Set by the add/edit actions, else null. Can be used by plugins to know if this is an add or edit operation.
protected bool $isEdit
return boolean