- Symphony 2.7.6
-
› assets
14 -
› boot
15 -
› core
24 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
61 -
› interface
9 -
› toolkit
60 - Delegates101
- Deprecated28
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public abstract class Event
class.event.php #18The abstract Event classes defines some base methods that all Events inherit.
It has one abstract method, __trigger()
, which Events must implement. Event
execution is determined based on an action (which maps to a form action
from the Frontend). A load function determines whether this Event matches
the action and if so, call the Event's __trigger()
to run the logic. On every page
load, all Event's that are attached to the page will have their load function's executed.
Events are called in order of their priority and if there is more than one event
with the same priority, in alphabetical order. An event class is saved through the
Symphony backend, which uses an event template defined in TEMPLATE . /event.tpl
Events implement the iEvent interface, which defines the load and about functions.
Constants
static integer kHIGH = 3
Represents High Priority, that this event should run first
static integer kLOW = 1
Represents High Priority, that this event should run last
static integer kNORMAL = 2
Represents Normal Priority, that this event should run normally. This is the default Event Priority
Methods
void __construct(
$env)
The constructor for an Event sets $this->_env
from the given parameters
Parameters
static boolean allowEditorToParse()
This function is required in order to edit it in the event editor page. Do not overload this function if you are creating a custom event. It is only used by the event editor.
Returns
true if event can be edited, false otherwise. Defaults to false
static string|XMLElement documentation()
Returns a string of HTML or an XMLElement of documentation for the current event.
By default this will be an example of a HTML form that can populate the chosen section and
any filter information. Documentation is shown in the Symphony backend when a user tries to
edit an event but it's allowEditorToParse()
returns false
. If this is not implemented by
the event, a default Symphony message will appear.
static mixed getNotificationTemplate(
$language)
Returns the path to the email-notification-template by looking at the
WORKSPACE/template/
directory, then at the TEMPLATES
directory for the convention notification.*.tpl
. If the template
is not found, false is returned
Parameters
Returns
String, which is the path to the template if the template is found, false otherwise
static integer getSource()
This function is required in order to identify what section this event is for. It is used in the event editor. It must remain intact. Do not overload this function in custom events.
integer priority()
Priority determines Event importance and when it should be executed.
The default priority for an event is Event::kNORMAL
, with Event::kHIGH
and
Event::kLOW
being the other available options. Events execution is Event::kHIGH
to Event::kNORMAL
to Event::kLOW
. If there are more than one event at the
same priority level, they are sorted alphabetically by event handle and executed
in that order for that priority.
Returns
The available constants are Event::kLOW
, Event::kNORMAL
and Event::kHIGH
. Defaults to Event::kNORMAL