before_restore
Overview
The before_restore logic hook executes before a record gets undeleted (i.e. the deleted
field's value changes from 1 to 0).
Definition
function before_restore($bean, $event, $arguments){}
Arguments
Name | Type | Description |
---|---|---|
bean | Object | The bean object |
event | String | The current event |
arguments | Array | Additional information related to the event (typically empty) |
Examples
Creating a Logic Hook using the Extension Framework
./custom/Extension/modules/<module>/Ext/LogicHooks/<file>.php
<?php
//Processing index. For sorting the array.
1,
//Label. A string value to identify the hook.
'before_restore example',
//The PHP file where your class is located.
'custom/modules/<module>/before_restore_class.php',
//The class the method is in.
'before_restore_class',
//The method to call.
'before_restore_method'
);
?>
./custom/modules/<module>/before_restore_class.php
<?php
class before_restore_class
{
function before_restore_method($bean, $event, $arguments)
{
//logic
}
}
?>