PHP Class Phergie_Event_Handler, phergie

Author: Phergie Development Team ([email protected])
Inheritance: implements IteratorAggregate, implements Countable
Afficher le fichier Open project: phergie/phergie Class Usage Examples

Protected Properties

Свойство Type Description
$events array Current queue of events

Méthodes publiques

Méthode Description
__construct ( ) : void Constructor to initialize the event queue.
addEvent ( Phergie_Plugin_Abstract $plugin, string $type, array $args = [] ) : Phergie_Event_Handler Adds an event to the queue.
clearEvents ( ) : Phergie_Event_Handler Clears the event queue.
count ( ) : integer Returns the number of events in the event queue
getEvents ( ) : array Returns the current event queue.
getEventsOfType ( string $type ) : array Returns a list of events of a specified type.
getIterator ( ) : ArrayIterator Returns an iterator for the current event queue.
hasEventOfType ( string $type ) : boolean Returns whether an event of the given type exists in the queue.
removeEvent ( Phergie_Event_Command $event ) : Phergie_Event_Handler Removes a single event from the event queue.
replaceEvents ( array $events ) : Phergie_Event_Handler Replaces the current event queue with a given queue of events.

Method Details

__construct() public méthode

Constructor to initialize the event queue.
public __construct ( ) : void
Résultat void

addEvent() public méthode

Adds an event to the queue.
public addEvent ( Phergie_Plugin_Abstract $plugin, string $type, array $args = [] ) : Phergie_Event_Handler
$plugin Phergie_Plugin_Abstract Plugin originating the event
$type string Event type, corresponding to a Phergie_Event_Command::TYPE_* constant
$args array Optional event arguments
Résultat Phergie_Event_Handler Provides a fluent interface

clearEvents() public méthode

Clears the event queue.
public clearEvents ( ) : Phergie_Event_Handler
Résultat Phergie_Event_Handler Provides a fluent interface

count() public méthode

Returns the number of events in the event queue
public count ( ) : integer
Résultat integer number of queued events

getEvents() public méthode

Returns the current event queue.
public getEvents ( ) : array
Résultat array Enumerated array of Phergie_Event_Command objects

getEventsOfType() public méthode

Returns a list of events of a specified type.
public getEventsOfType ( string $type ) : array
$type string Event type from Phergie_Event_Request::TYPE_* constants
Résultat array Array containing event instances of the specified type or an empty array if no such events were found

getIterator() public méthode

Returns an iterator for the current event queue.
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

hasEventOfType() public méthode

Returns whether an event of the given type exists in the queue.
public hasEventOfType ( string $type ) : boolean
$type string Event type from Phergie_Event_Request::TYPE_* constants
Résultat boolean TRUE if an event of the specified type exists in the queue, FALSE otherwise

removeEvent() public méthode

Removes a single event from the event queue.
public removeEvent ( Phergie_Event_Command $event ) : Phergie_Event_Handler
$event Phergie_Event_Command Event to remove
Résultat Phergie_Event_Handler Provides a fluent interface

replaceEvents() public méthode

Replaces the current event queue with a given queue of events.
public replaceEvents ( array $events ) : Phergie_Event_Handler
$events array Ordered list of objects of the class Phergie_Event_Command
Résultat Phergie_Event_Handler Provides a fluent interface

Property Details

$events protected_oe property

Current queue of events
protected array $events
Résultat array