Class: atkActionListener
Source Location: /utils/class.atkactionlistener.inc
Class atkActionListener
Class Overview
|
The atkActionListener baseclass for handling ATK events.
The most useful purpose of the atkActionListener is to serve as a base class for custom action listeners. Extend this class and override only the notify($action, $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.atkactionlistener.inc [line 33]
Wiki documentation
Author(s):
Information Tags:
|
Properties
|
Methods
|
Descendants
| atkEventLog |
The atkEventLog is a ready to use atkActionListener for logging events in a table.
|
Property Summary
| Array |
$m_actionfilter |
The list of actions the action listener should listen to. |
Method Summary
| void |
notify() |
Notify the listener of any action on a record. |
| void |
preActionPerformed() |
Notify the listener of an action about to be performed on a record. |
| void |
preNotify() |
Notify the listener of any action about to be performed on a record. |
| void |
setNode() |
Set the owning node of the listener. |
Properties
The list of actions the action listener should listen to.
API Tags:
The owning node of the listener.
API Tags:
Methods
Base constructor
Parameters:
|
array |
$actionfilter: |
The list of actions to listen to |
void actionPerformed(
String
$action, array
$record
)
|
|
Notify the listener of an action on a record.
This method should be overriden in custom action listeners, to catch the action event.
Parameters:
|
String |
$action: |
The action being performed |
|
array |
$record: |
The record on which the action is performed |
API Tags:
Redefined in descendants as:
void notify(
String
$action, 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 |
$action: |
The action being performed |
|
array |
$record: |
The record on which the action is performed |
void preActionPerformed(
String
$action,
&$record, array
$record
)
|
|
Notify the listener of an action about to be performed on a record.
This method should be overriden in custom action listeners, to catch the action event.
Parameters:
|
String |
$action: |
The action about to be performed |
|
array |
$record: |
The record on which the action is about to be performed |
|
|
&$record: |
|
API Tags:
void preNotify(
String
$action,
&$record, array
$record
)
|
|
Notify the listener of any action about to be performed 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 preActionPerformed($action, $record) method.
Parameters:
|
String |
$action: |
The action about to be performed |
|
array |
$record: |
The record on which the action is about to be performed |
|
|
&$record: |
|
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: |
|