PHP Class Bluz\EventManager\EventManager

Show file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$listeners list of listeners

Public Methods

Method Description
attach ( string $eventName, callable $callback, integer $priority = 1 ) : EventManager Attach callback to event
trigger ( string $event, string | object $target = null, array | object $params = null ) : string | object Trigger event

Protected Methods

Method Description
fire ( array $listeners, Event $event ) : EventManager Fire!

Method Details

attach() public method

Attach callback to event
public attach ( string $eventName, callable $callback, integer $priority = 1 ) : EventManager
$eventName string
$callback callable
$priority integer
return EventManager

fire() protected method

Fire!
protected fire ( array $listeners, Event $event ) : EventManager
$listeners array
$event Event
return EventManager

trigger() public method

Trigger event
public trigger ( string $event, string | object $target = null, array | object $params = null ) : string | object
$event string
$target string | object
$params array | object
return string | object

Property Details

$listeners protected property

list of listeners
protected $listeners