1
0
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:
Ryan Cramer
2020-03-25 09:28:45 -04:00
parent f54342a20c
commit 78b7d198a7

View File

@@ -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);
}