ZMObject
└─ZMEvents
public class ZMEvents
extends ZMObject
| Constant Summary | |
|---|---|
| final static str | Fired after the inital code load is done. |
| final static str | Fired once all code has been loaded and plugins are initialized. |
| final static str | Fired once a group of plugins has been loaded and initialized. |
| Field Summary | |
|---|---|
| protected mixed | |
| protected mixed | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| 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 event. |
| array | Get the event log. |
| static void | instance() Get instance. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public final static str BOOTSTRAP_DONE = 'bootstrap_done'
Fired after the inital code load is done.
public final static str INIT_DONE = 'init_done'
Fired once all code has been loaded and plugins are initialized.
public final static str INIT_PLUGIN_GROUP_DONE = 'init_plugin_group_done'
Fired once a group of plugins has been loaded and initialized.
protected mixed $eventLog_
protected mixed $subscribers_
public void __construct()
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 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.
Event service.
Generic event service that resolves events by converting the event id to a callback method name.
.