Class jEvent

Description

Class which represents an event in the event system

Located in /events/jEvent.class.php (line 29)


	
			
Variable Summary
static mixed $compilerData
static associative $hashListened
static array $listenersSingleton
string $_name
mixed $_params
array $_responses
Method Summary
static array loadListenersFor (string $eventName)
static jEvent notify ( $eventname, [ $params = array()], string $event)
jEvent __construct (string $name, [array $params = array()])
void add (array $response)
void getName ()
void getParam (string $name)
array getResponse ()
boolean inResponse (string $responseName, mixed $value,  &$response, ref $response)
Variables
static mixed $compilerData = array('jEventCompiler',
'events/jEventCompiler.class.php',
'events.xml',
'events.php'
)
(line 140)
  • access: protected
static associative $hashListened = array () (line 159)

hash table for event listened.

$_hash['eventName'] = array of events (by reference)

  • var: array of object
  • access: protected
static array $listenersSingleton = array () (line 152)

because a listener can listen several events, we should create only one instancy of a listener for performance, and $hashListened will contains only reference to this listener.

  • var: of jEventListener
  • access: protected
string $_name = null (line 34)

The name of the event.

  • var: name
  • access: protected
mixed $_params = null (line 39)

the event parameters

  • access: protected
array $_responses = array () (line 44)
  • var: of array
  • access: protected
Methods
static loadListenersFor (line 166)

return the list of all listener corresponding to an event

  • return: of objects
  • access: protected
static array loadListenersFor (string $eventName)
  • string $eventName: the event name we wants the listeners for.
static notify (line 124)

send a notification to all modules

  • access: public
static jEvent notify ( $eventname, [ $params = array()], string $event)
  • string $event: the event name
  • $eventname
  • $params
Constructor __construct (line 51)

New event.

jEvent __construct (string $name, [array $params = array()])
  • string $name: the event name
  • array $params: an associative array which contains parameters for the listeners
add (line 81)

adds data in the responses list

  • access: public
void add (array $response)
  • array $response: a single response
getName (line 60)

gets the name of the event

will be used internally for optimisations

  • access: public
void getName ()
getParam (line 68)

gets the given param

  • access: public
void getParam (string $name)
  • string $name: the param name
getResponse (line 111)

gets all the responses

  • return: of associative array
  • access: public
array getResponse ()
inResponse (line 93)

look in all the responses if we have a parameter having value as its answer

eg, we want to know if we have failed = true, we do

  • return: wether or not we have founded the response value
  • access: public
boolean inResponse (string $responseName, mixed $value,  &$response, ref $response)
  • string $responseName: the param we're looking for
  • mixed $value: the value we're looking for
  • ref $response: the response that have this value
  • &$response

Documentation generated on Thu, 19 Sep 2013 00:04:16 +0200 by phpDocumentor 1.4.3