PHP 클래스 Phergie_Event_Handler, phergie

저자: Phergie Development Team ([email protected])
상속: implements IteratorAggregate, implements Countable
파일 보기 프로젝트 열기: phergie/phergie 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$events array Current queue of events

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

Constructor to initialize the event queue.
public __construct ( ) : void
리턴 void

addEvent() 공개 메소드

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
리턴 Phergie_Event_Handler Provides a fluent interface

clearEvents() 공개 메소드

Clears the event queue.
public clearEvents ( ) : Phergie_Event_Handler
리턴 Phergie_Event_Handler Provides a fluent interface

count() 공개 메소드

Returns the number of events in the event queue
public count ( ) : integer
리턴 integer number of queued events

getEvents() 공개 메소드

Returns the current event queue.
public getEvents ( ) : array
리턴 array Enumerated array of Phergie_Event_Command objects

getEventsOfType() 공개 메소드

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

getIterator() 공개 메소드

Returns an iterator for the current event queue.

hasEventOfType() 공개 메소드

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
리턴 boolean TRUE if an event of the specified type exists in the queue, FALSE otherwise

removeEvent() 공개 메소드

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

replaceEvents() 공개 메소드

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
리턴 Phergie_Event_Handler Provides a fluent interface

프로퍼티 상세

$events 보호되어 있는 프로퍼티

Current queue of events
protected array $events
리턴 array