mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 12:10:45 +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);
|
* $event->removeHook(null);
|
||||||
* ~~~~~
|
* ~~~~~
|
||||||
*
|
*
|
||||||
* @param string|null $hookId
|
* @param string|HookEvent|null $hookId
|
||||||
* @return HookEvent|WireData $this
|
* @return HookEvent|WireData $this
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function removeHook($hookId) {
|
public function removeHook($hookId) {
|
||||||
if(empty($hookId)) {
|
if(empty($hookId) || $hookId === $this) {
|
||||||
if($this->object && $this->id) {
|
if($this->object && $this->id) {
|
||||||
$this->object->removeHook($this->id);
|
$this->object->removeHook($this->id);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user