Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb_event_dispatcher

pxdb_event_dispatcher

private class pxdb_event_dispatcher

 

Public Method Summary

void pxdb_event_dispatcher()
Constructor
object [unknown] &singleton()
Singleton - returns same instance of this object on each call.
void mapTrigger(object listener $listener, string $trigger)
Adds a single listener to the notification list for a trigger.
void notify(string $trigger, array $parameters)
Used by scripts to initiate notification of a listeners
void suppressNotification(string $trigger, int $id)
Used by scripts to suppress notifications for certain triggers on
void unsuppressNotification(string $trigger, int $id)
Used after suppressNotification() to turn notifications
void resetSuppressNotification(string $trigger, int $id)
Similar to unsuppressNotification() except this completely resets the
void isNotificationSuppressed(string $trigger, int $id)
Tests to see if a notification trigger for a particular record/object has
void wasNotificationSuppressed(string $trigger, int $id)
Tests to see if a notification trigger for a particular record/object that

Private Method Summary

void loadListeners( $path)
Loads and hooks in all the event listeners in the specified directory.
void registerListener( $listener)
Maps all listener triggers internally

Private Field Summary

array $_notify_on
Internal queue of events to notify when a trigger is activated.

Private Constant Summary

SYNTAX_EVENT_INSERT >>syntax_event_insert<< SYNTAX_EVENT_INSERT - a new record has been added *
SYNTAX_EVENT_UPDATE >>syntax_event_update<< SYNTAX_EVENT_UPDATE - an existing record is updated *
SYNTAX_EVENT_DELETE >>syntax_event_delete<< SYNTAX_EVENT_DELETE - an existing record was deleted *
SYNTAX_EVENT_APPROVE >>syntax_event_approve<< SYNTAX_EVENT_APPROVE - a record is approved *
SYNTAX_EVENT_UNAPPROVE >>syntax_event_unapprove<< SYNTAX_EVENT_UNAPPROVE - a record is unapproved *
SYNTAX_EVENT_PUBLISH >>syntax_event_publish<< SYNTAX_EVENT_PUBLISH - a record is publishd *
SYNTAX_EVENT_UNPUBLISH >>syntax_event_unpublish<< SYNTAX_EVENT_UNPUBLISH - a record is unpublishd *
SYNTAX_EVENT_PREDELETE >>syntax_event_predelete<< SYNTAX_EVENT_PREDELETE - a record is predeleted *
SYNTAX_EVENT_PREUPDATE >>syntax_event_preupdate<< SYNTAX_EVENT_PREUPDATE - a record is about to be updated *

Included files Summary, Type: require_once

$path.'/'.$file Warning: documentation is missing.

Public Method Details

pxdb_event_dispatcher

public void pxdb_event_dispatcher()

 

Returns void


&singleton

public object [unknown] &singleton()

 

Returns object [unknown]


mapTrigger

public void mapTrigger(object listener $listener, string $trigger)

 

Parameter
object listener $listener
object
string $trigger
name
Returns void


notify

public void notify(string $trigger, array $parameters)

 

Parameter
string $trigger
name, expected by listeners
array $parameters
to pass to listeners on notification
Returns void


suppressNotification

public void suppressNotification(string $trigger, int $id)

  particular records/objects. This is user session specific and allows developers of event listeners to work on Syntax objects and suppress triggers on those objects. This is one way to prevent infinite loops but also allows more control of when notifications are processed.

Parameter
string $trigger
- name of trigger to suppress
int $id
- record id for object to suppress triggers
Returns void


unsuppressNotification

public void unsuppressNotification(string $trigger, int $id)

  back on. You must call this after working with your object or you could suppress notifications on that record for the rest of the user session.

Parameter
string $trigger
- name of trigger to unsuppress
int $id
- record id for object to unsuppress triggers
Returns void


resetSuppressNotification

public void resetSuppressNotification(string $trigger, int $id)

  suppress (stored in the PHP session) return the system back to it's previous state. On the other hand unsuppressNotification() leaves evidence that the trigger has been suppressed which can be detected by calling the wasNotificationSuppressed() method.

Parameter
string $trigger
- name of trigger to unsuppress and reset
int $id
- record id for object to unsuppress and reset triggers
Returns void


isNotificationSuppressed

public void isNotificationSuppressed(string $trigger, int $id)

  been suppressed.

Parameter
string $trigger
- name of trigger to test
int $id
- record id for object to test
Returns void


wasNotificationSuppressed

public void wasNotificationSuppressed(string $trigger, int $id)

  is currently active was suppressed at some point during the user session.

Parameter
string $trigger
- name of trigger to test
int $id
- record id for object to test
Returns void


Private Method Details

loadListeners

private void loadListeners( $path)

  Expects all files in the directory to be names .class.php and the class name should same as

Parameter
$path
Warning: documentation is missing.
Returns void


registerListener

private void registerListener( $listener)

 

Parameter
$listener
Warning: documentation is missing.
Returns void


Private Field Details

$_notify_on

private array $_notify_on

>>array()<<


Private Constant Details

SYNTAX_EVENT_INSERT

define( SYNTAX_EVENT_INSERT, >>syntax_event_insert<< )
Case: default: case sensitive


SYNTAX_EVENT_UPDATE

define( SYNTAX_EVENT_UPDATE, >>syntax_event_update<< )
Case: default: case sensitive


SYNTAX_EVENT_DELETE

define( SYNTAX_EVENT_DELETE, >>syntax_event_delete<< )
Case: default: case sensitive


SYNTAX_EVENT_APPROVE

define( SYNTAX_EVENT_APPROVE, >>syntax_event_approve<< )
Case: default: case sensitive


SYNTAX_EVENT_UNAPPROVE

define( SYNTAX_EVENT_UNAPPROVE, >>syntax_event_unapprove<< )
Case: default: case sensitive


SYNTAX_EVENT_PUBLISH

define( SYNTAX_EVENT_PUBLISH, >>syntax_event_publish<< )
Case: default: case sensitive


SYNTAX_EVENT_UNPUBLISH

define( SYNTAX_EVENT_UNPUBLISH, >>syntax_event_unpublish<< )
Case: default: case sensitive


SYNTAX_EVENT_PREDELETE

define( SYNTAX_EVENT_PREDELETE, >>syntax_event_predelete<< )
Case: default: case sensitive


SYNTAX_EVENT_PREUPDATE

define( SYNTAX_EVENT_PREUPDATE, >>syntax_event_preupdate<< )
Case: default: case sensitive


Included Files, Type: require_once

$path.'/'.$file

require_once( $path.'/'.$file )



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de