ZMObject
|
+--ZMEvents
public class ZMEvents
extends ZMObject
| Constructor Summary | |
|---|---|
ZMEvents() Create new instance. |
|
| Method Summary | |
|---|---|
| void | attach(mixed observer) Attach an observer to this event source. |
| void | detach(mixed observer) Detach an observer from the notifier object |
| protected string | event2method(string eventId, string prefix) Convert the event id to a method name. |
| void | 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 observer callback that delegates to internal methods... |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| backtrace, create, log, singleton | |
public ZMEvents()
Create new instance. /
public void attach(mixed observer)
Attach an observer to this event source.
public void detach(mixed observer)
Detach an observer from the notifier object
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 void fireEvent(mixed source, string eventId, array args)
Fire ZenMagick event.
ZenMagick event methods start with onZM.
A reference of the event source is added to the optional arguments map with the key source.
array().public array getEventLog()
Get the event log.
public static void instance()
Get instance. /
public void update(mixed notifier, string eventId, array args)
Generic 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.
.