PHP Class Pop\Event\Manager

Author: Nick Sagona, III ([email protected])
Inheritance: implements ArrayAccess, implements Countable, implements IteratorAggregate
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$alive boolean Event 'alive' tracking flag
$listeners array Event listeners
$results array Event results

Public Methods

Method Description
__construct ( string $name = null, mixed $action = null, integer $priority ) : Manager Constructor
alive ( ) : boolean Method to if the project application is still alive or has been killed
attach ( string $name, mixed $action, integer $priority ) : Manager Method to attach an event listener
detach ( string $name, mixed $action ) : Manager Method to detach an event listener
get ( string $name ) : mixed Method to return an event
getResults ( string $name ) : mixed Method to return the event results
trigger ( string $name, array $args = [] ) : void Method to trigger an event listener priority

Method Details

__construct() public method

Instantiate the event Manager object.
public __construct ( string $name = null, mixed $action = null, integer $priority ) : Manager
$name string
$action mixed
$priority integer
return Manager

alive() public method

Method to if the project application is still alive or has been killed
public alive ( ) : boolean
return boolean

attach() public method

Method to attach an event listener
public attach ( string $name, mixed $action, integer $priority ) : Manager
$name string
$action mixed
$priority integer
return Manager

detach() public method

Method to detach an event listener
public detach ( string $name, mixed $action ) : Manager
$name string
$action mixed
return Manager

get() public method

Method to return an event
public get ( string $name ) : mixed
$name string
return mixed

getResults() public method

Method to return the event results
public getResults ( string $name ) : mixed
$name string
return mixed

trigger() public method

Method to trigger an event listener priority
public trigger ( string $name, array $args = [] ) : void
$name string
$args array
return void

Property Details

$alive protected property

Event 'alive' tracking flag
protected bool $alive
return boolean

$listeners protected property

Event listeners
protected array $listeners
return array

$results protected property

Event results
protected array $results
return array