Class: atkRecycleBin
Source Location: /listeners/class.atkrecyclebin.inc
Class atkRecycleBin
Class Overview
|
The atkRecycleBin is a generic recycle bin for records. You can add it to any node and if a record from that node will get deleted, atkRecycleBin will kick in and transfer the record to the recyclebin.
There are 2 modes of operation. You can build your own recyclebin node, and atkRecycleBin will use that to store the deleted record. Alternatively, you can skip creating a node, and just create a table that is identical to the one you're deleting records from. If you don't specify this table, atkRecycleBin will assume that the table is called tablename_bin, where tablename is the tablename from the node you're deleting records from. Usage: $node->addListener(new atkRecycleBin());
Located in /listeners/class.atkrecyclebin.inc [line 43]
Wiki documentation
atkTriggerListener
|
--atkRecycleBin
Author(s):
Information Tags:
| Todo: | a third mode of operation might be one serialized recyclebin for all the tables in the application. |
|
Properties
|
Methods
|
Property Summary
| mixed |
$_options |
The options for the recycle bin. |
Method Summary
| atkRecycleBin |
__construct() |
Construct a new atkRecycleBin |
| false |
preDelete() |
This is the actual trigger that moves the record to the recycle bin table. |
Properties
The options for the recycle bin.
API Tags:
Methods
atkRecycleBin __construct(
[array
$options = array()]
)
|
|
Construct a new atkRecycleBin
Parameters:
|
array |
$options: |
Supports the following keys: "node" - Use a specific node as the recyclebin "table" - Use a specfic table as the recyclebin (table needs to be identical to the table the records are deleted from. If both table and node are ommitted, a default table with appendix _bin is assumed. |
API Tags:
false preDelete(
array
$record
)
|
|
This is the actual trigger that moves the record to the recycle bin table.
Parameters:
|
array |
$record: |
The record that is being deleted |
API Tags:
| Return: | if there was an error, true if everything is ok |
| Access: | public |