ZMObject
└─ZMEvents
public class ZMEvents
extends ZMObject
| Field Summary | |
|---|---|
| final str | Fired after the inital code load is done. |
| final str | Fired once all code has been loaded and plugins are initialized. |
| final str | Fired once a group of plugins has been loaded and initialized. |
| protected mixed | |
| protected mixed | |
| Fields inherited from org.zenmagick.core.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 event. |
| array | Get the event log. |
| static void | instance() Get instance. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final str BOOTSTRAP_DONE = 'bootstrap_done'
Fired after the inital code load is done.
public final str INIT_DONE = 'init_done'
Fired once all code has been loaded and plugins are initialized.
public final 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 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 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.
.