After Delete
public function onAfterDelete{$type}( string $id, JTable $table ) : void
Fires after deleting a record.
Description
Trigger hook to allow the plugins to make something after deleting a record from the database. Contrarily to onBeforeDelete{$type} hook, this one triggers once for each ID to delete.
The dynamic portion of the hook name, $type, refers to the name of the table calling the hook. This means that, for example, the room table will trigger an hook called onAfterDeleteRoom. The name of the table is always equals to the base name of the file that declares the $table instance.
It is possible to read a list of supported types by looking at the files stored within the following directory:
/administrator/components/com_vikrestaurants/tables/
Parameters
- $id
-
(string) The ID of the deleted record.
- $table
-
(JTable) The table instance that handles the saving process.
Return Value
None.
Example
/**
* Trigger hook to allow the plugins to make something after deleting
* a record from the database.
*
* @param string $id The ID of the deleted record.
* @param JTable $table The table instance.
*
* @return void
*/
public function onAfterDeleteReservation($id, $table)
{
/**
* @todo do something after deleting a record
*/
}
Changelog
| Version | Description |
|---|---|
| 1.9 | Introduced. |
Last Update: 2023-12-29 14:15
Helpful?