mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Create "threadDelete" event
This commit is contained in:
parent
60bd21bf42
commit
53450ea9d6
@ -177,6 +177,15 @@ final class Events
|
||||
*/
|
||||
const THREAD_UPDATE = 'threadUpdate';
|
||||
|
||||
/**
|
||||
* A thread is deleted.
|
||||
*
|
||||
* This event is triggered after a thread has been deleted. An associative
|
||||
* array with the following items is passed to the event handlers:
|
||||
* - "id": int, deleted thread ID.
|
||||
*/
|
||||
const THREAD_DELETE = 'threadDelete';
|
||||
|
||||
/**
|
||||
* Threads list is ready to be sent to client.
|
||||
*
|
||||
|
@ -532,6 +532,8 @@ class Thread
|
||||
|
||||
/**
|
||||
* Remove thread from database
|
||||
*
|
||||
* Triggers {@link \Mibew\EventDispatcher\Events::THREAD_DELETE} event.
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
@ -540,6 +542,9 @@ class Thread
|
||||
"DELETE FROM {thread} WHERE threadid = :id LIMIT 1",
|
||||
array(':id' => $this->id)
|
||||
);
|
||||
|
||||
$args = array('id' => $this->id);
|
||||
EventDispatcher::getInstance()->triggerEvent(Events::THREAD_DELETE, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user