Update Events.php

This commit is contained in:
Daniil Gentili 2020-02-15 14:34:53 +01:00 committed by GitHub
parent d7359b6f77
commit df8f50dff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -85,6 +85,23 @@ trait Events
$this->startUpdateSystem();
}
}
/**
* Unset event handler.
*
* @param bool $disableUpdateHandling Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler)
*
* @return void
*/
public function unsetEventHandler(bool $disableUpdateHandling = false): void
{
$this->event_handler = null;
$this->event_handler_instance = null;
$this->event_handler_methods = [];
$this->setNoop();
if ($disableUpdateHandling) {
$this->settings['updates']['handle_updates'] = false;
}
}
/**
* Get event handler.
*