Class: atkTriggerListener
Source Location: /utils/class.atktriggerlistener.inc
Class atkTriggerListener
Class Overview
|
The atkTriggerListener base class for handling trigger events on records.
The most useful purpose of the atkTriggerListener is to serve as a base class for custom trigger listeners. Extend this class and override only the notify($trigger, $record) method. Using atkNode::addListener you can add listeners that catch evens such as records updates and additions. This is much like the classic atk postUpdate/postAdd triggers, only much more flexible.
Located in /utils/class.atktriggerlistener.inc [line 33]
Wiki documentation
Author(s):
Information Tags:
|
Properties
|
Methods
|
Method Summary
| boolean |
notify() |
Notify the listener of any action on a record. |
| void |
setNode() |
Set the owning node of the listener. |
Properties
The owning node of the listener.
API Tags:
Methods
boolean notify(
String
$trigger,
&$record, [string
$mode = NULL], array
$record
)
|
|
Notify the listener of any action on a record.
This method is called by the framework for each action called on a node. Depending on the actionfilter passed in the constructor, the call is forwarded to the actionPerformed($action, $record) method.
Parameters:
|
String |
$trigger: |
The trigger being performed |
|
array |
$record: |
The record on which the trigger is performed |
|
string |
$mode: |
The mode (add/update) |
|
|
&$record: |
|
API Tags:
| Return: | Result of operation. |
void setNode(
&$node, atkNode
$node
)
|
|
Set the owning node of the listener.
When using atkNode::addListener to add a listener to a node it is not necessary to call this method as addListener will do that for you.
Parameters:
|
atkNode |
$node: |
The node to set as owner |
|
|
&$node: |
|