PhpToolCase
Api Documentation Version 0.9.2
PtcEvent Class Reference

Static Public Member Functions

static getEvent ($name=null)
 Alias of PtcEvent::getEvents( ). More...
 
static register ()
 Registers the component with a constant for ptc helpers functions. More...
 
static listen ($event, $callback, $priority=0)
 Adds a listener to an event. More...
 
static getEvents ($name=null)
 Returs the current events. More...
 
static remove ($event, $key=null)
 Removes previously added event listeners. More...
 
static fire ($event, $data)
 Fires an event. More...
 

Static Protected Member Functions

static _addEvent ($event, $call, $priority=0)
 Adds events to the class. More...
 
static _run ($event, $data)
 Runs an event with call_user_func_array. More...
 
static _debug ($string, $statement=null, $category=null)
 Send messsages to the PtcDebug class if present. More...
 

Static Protected Attributes

static $_events = array( )
 Property that holds the events. More...
 
static $_wildCards = array( )
 Property that holds the wildcards. More...
 

Member Function Documentation

static _addEvent (   $event,
  $call,
  $priority = 0 
)
staticprotected

Adds events to the class.

Parameters
string$eventsome name for the event
mixed$callsome valid callback
numeric$prioritythe priority for the event

Definition at line 180 of file PtcEvent.php.

static _debug (   $string,
  $statement = null,
  $category = null 
)
staticprotected

Send messsages to the PtcDebug class if present.

Parameters
mixed$stringthe string to pass
mixed$statementsome statement if required
string$categorya category for the messages panel

Definition at line 214 of file PtcEvent.php.

static _run (   $event,
  $data 
)
staticprotected

Runs an event with call_user_func_array.

Parameters
string$eventa valid callback
mixed$dataarguments for the event callbacks

Definition at line 203 of file PtcEvent.php.

static fire (   $event,
  $data 
)
static

Fires an event.

See Firing Events

Parameters
string$eventthe event name to fire
array$dataan array with the data you wish to pass to the listeners

Definition at line 129 of file PtcEvent.php.

static getEvent (   $name = null)
static

Alias of PtcEvent::getEvents( ).

See Retrieving Previously Added Events

Definition at line 18 of file PtcEvent.php.

static getEvents (   $name = null)
static

Returs the current events.

See Retrieving Previously Added Events

Parameters
string$namepreviously added event name

Definition at line 81 of file PtcEvent.php.

static listen (   $event,
  $callback,
  $priority = 0 
)
static

Adds a listener to an event.

See Adding Event Listeners

Parameters
string$eventthe event name, ex: "event.sub_event"
mixed$callbacka valid callback ( closure , function , class )
numeric$prioritya numeric value, higher values will execute first
Returns
true if event was added succefully, throws an error otherwise

Definition at line 37 of file PtcEvent.php.

static register ( )
static

Registers the component with a constant for ptc helpers functions.

See Using The Library Helpers

Definition at line 22 of file PtcEvent.php.

static remove (   $event,
  $key = null 
)
static

Removes previously added event listeners.

See Removing Event Listeners

Parameters
string$eventthe name of the event
numeric$keythe numeric key for the event

Definition at line 91 of file PtcEvent.php.

Field Documentation

$_events = array( )
staticprotected

Property that holds the events.

Definition at line 169 of file PtcEvent.php.

$_wildCards = array( )
staticprotected

Property that holds the wildcards.

Definition at line 173 of file PtcEvent.php.


The documentation for this class was generated from the following file: