SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
SlaxWeb\Hooks\Container Class Reference

Public Member Functions

 __construct (\Psr\Log\LoggerInterface $logger)
 
 addHook (Hook $hook)
 
 exec (string $name)
 
 setParams (array $params)
 
 stopExec ()
 

Protected Attributes

 $logger = null
 
 $hooks = []
 
 $params = []
 
 $stop = false
 

Constructor & Destructor Documentation

SlaxWeb\Hooks\Container::__construct ( \Psr\Log\LoggerInterface  $logger)

Class constructor

Instantiates the Container, and sets the Logger to the protected property and writes the successful init message to the logger.

Parameters
\Psr\Log\LoggerInterface$loggerLogger that implements the PSR interface

Member Function Documentation

SlaxWeb\Hooks\Container::addHook ( Hook  $hook)

Add hook definition to container

Parameters
\SlaxWeb\Hooks\Hook$hookHook definition
Returns
void
SlaxWeb\Hooks\Container::exec ( string  $name)

Execute hook definition

Execute all definitions for the retrieved hook names in the order that they have been inserted, and store their return values in an array, if it is not null. If only one definition was called, then return that executions return value directly, if there were more calls, return all the return values in an array.

Parameters
stringHook name
Returns
mixed
SlaxWeb\Hooks\Container::setParams ( array  $params)

Set parameters

Set parameters to be used in hook executions.

Parameters
array$paramsArray of parameters
Returns
SlaxWeb\Hooks\Container::stopExec ( )

Prevent further execution

Stops execution of all further defined hook definitions.

Returns
void

The documentation for this class was generated from the following file: