Phergie
[ class tree: Phergie ] [ index: Phergie ] [ all elements ]

Class: Phergie_Event_Handler

Source Location: /Phergie/Event/Handler.php

Class Overview


Handles events initiated by plugins.


Author(s):

Implements interfaces:

  • IteratorAggregate (internal interface)
  • Countable (internal interface)

Variables

Methods



Class Details

[line 31]
Handles events initiated by plugins.



Tags:

author:  Phergie Development Team <team@phergie.org>
link:  http://pear.phergie.org/package/Phergie
license:  New BSD License


[ Top ]


Class Variables

$events =

[line 38]

Current queue of events



Tags:

access:  protected

Type:   array


[ Top ]



Class Methods


constructor __construct [line 45]

void __construct( )

Constructor to initialize the event queue.



Tags:

access:  public


[ Top ]

method addEvent [line 60]

Phergie_Event_Handler addEvent( Phergie_Plugin_Abstract $plugin, string $type, [ $args = array()])

Adds an event to the queue.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

Phergie_Plugin_Abstract   $plugin   Plugin originating the event
string   $type   Event type, corresponding to a Phergie_Event_Command::TYPE_* constant
array   $args   Optional event arguments

[ Top ]

method clearEvents [line 96]

Phergie_Event_Handler clearEvents( )

Clears the event queue.



Tags:

return:  Provides a fluent interface
access:  public


[ Top ]

method count [line 186]

int count( )

Returns the number of events in the event queue



Tags:

return:  number of queued events
access:  public



Implementation of:
Countable::count
[ Top ]

method getEvents [line 86]

array getEvents( )

Returns the current event queue.



Tags:

return:  Enumerated array of Phergie_Event_Command objects
access:  public


[ Top ]

method getEventsOfType [line 144]

array getEventsOfType( string $type)

Returns a list of events of a specified type.



Tags:

return:  Array containing event instances of the specified type or an empty array if no such events were found
access:  public


Parameters:

string   $type   Event type from Phergie_Event_Request::TYPE_* constants

[ Top ]

method getIterator [line 176]

ArrayIterator getIterator( )

Returns an iterator for the current event queue.



Tags:

access:  public



Implementation of:
IteratorAggregate::getIterator
[ Top ]

method hasEventOfType [line 125]

bool hasEventOfType( string $type)

Returns whether an event of the given type exists in the queue.



Tags:

return:  TRUE if an event of the specified type exists in the queue, FALSE otherwise
access:  public


Parameters:

string   $type   Event type from Phergie_Event_Request::TYPE_* constants

[ Top ]

method removeEvent [line 162]

Phergie_Event_Handler removeEvent( Phergie_Event_Command $event)

Removes a single event from the event queue.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

Phergie_Event_Command   $event   Event to remove

[ Top ]

method replaceEvents [line 110]

Phergie_Event_Handler replaceEvents( $events)

Replaces the current event queue with a given queue of events.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

array   $events   Ordered list of objects of the class Phergie_Event_Command

[ Top ]


Documentation generated on Mon, 27 Sep 2010 23:03:48 -0500 by phpDocumentor 1.4.3