mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 10:15:28 +02:00
Update HookEvent::removeHook($key) so that it also accepts itself (HookEvent instance) as the $key
This commit is contained in:
@@ -207,12 +207,12 @@ class HookEvent extends WireData {
|
||||
* $event->removeHook(null);
|
||||
* ~~~~~
|
||||
*
|
||||
* @param string|null $hookId
|
||||
* @param string|HookEvent|null $hookId
|
||||
* @return HookEvent|WireData $this
|
||||
*
|
||||
*/
|
||||
public function removeHook($hookId) {
|
||||
if(empty($hookId)) {
|
||||
if(empty($hookId) || $hookId === $this) {
|
||||
if($this->object && $this->id) {
|
||||
$this->object->removeHook($this->id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user