ZMObject
|
+--ZMEvents
public class ZMEvents
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMEvents() Create new instance. |
|
| Method Summary | |
|---|---|
| void | attach(mixed subscriber) Attach a subscriber to this event source. |
| void | detach(mixed subscriber) Detach a subscriber. |
| protected string | event2method(string eventId, string prefix) Convert the event id to a method name. |
| array | fireEvent(mixed source, string eventId, array args) Fire ZenMagick event. |
| array | Get the event log. |
| static void | instance() Get instance. |
| void | update(mixed notifier, string eventId, array args) Generic zen-cart observer callback that delegates to internal methods... |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed ALL_DONE = 'all_done'
public final mixed BOOTSTRAP_DONE = 'bootstrap_done'
public final mixed CONTROLLER_PROCESS_END = 'controller_process_end'
public final mixed CONTROLLER_PROCESS_START = 'controller_process_start'
public final mixed CREATE_ACCOUNT = 'create_account'
public final mixed CREATE_ORDER = 'create_order'
public final mixed DISPATCH_DONE = 'dispatch_done'
public final mixed DISPATCH_START = 'dispatch_start'
public final mixed FINALISE_CONTENTS = 'finalise_contents'
public final mixed GENERATE_EMAIL = 'generate_email'
public final mixed INIT_DONE = 'init_done'
public final mixed LOGIN_SUCCESS = 'login_success'
public final mixed LOGOFF_SUCCESS = 'logoff_success'
public final mixed PASSWORD_CHANGED = 'password_changed'
public final mixed THEME_RESOLVED = 'theme_resolved'
public final mixed VIEW_DONE = 'view_done'
public final mixed VIEW_START = 'view_start'
public ZMEvents()
Create new instance. /
public void attach(mixed subscriber)
Attach a subscriber to this event source.
public void detach(mixed subscriber)
Detach a subscriber.
protected string event2method(string eventId, string prefix)
Convert the event id to a method name.
Callback method names must follow the following conventions:
For example, to handle the event NOTIFY_MODULE_END_CREATE_ACCOUNT, the method name would be
onNotifyLoginSuccessViaCreateAccount(..).
on'.public array fireEvent(mixed source, string eventId, array args)
Fire ZenMagick event.
Subscriber may opt to return the passed in $args array or a modified version or null.
If null (or nothing) is returned, the orignal argument array is kept, if the return value is of
type array it is used as new $args for the next subscriber call and as final return value.
ZenMagick event methods start with onZM.
A reference of the event source is added to the optional arguments map with the key source.
array().$args.public array getEventLog()
Get the event log.
public static void instance()
Get instance. /
public void update(mixed notifier, string eventId, array args)
Generic zen-cart observer callback that delegates to internal methods...
The actual method called is generated based on the event id.
null.
Event service.
This service will relay *all* zen-cart events to registered listeners. Subscriber have to implement the same
update(..)as for registering with zen-cart directly.Any class can subscribe. Any method of the subscriber class that matches a method name derived from a zen-cart event will be called automatically.
.