. /** * Handlers of observers for events. * * @copyright 2018 'Valentin Popov' * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package local_webhooks */ namespace local_webhooks; defined('MOODLE_INTERNAL') || die(); /** * Defines event handlers. * * @copyright 2018 'Valentin Popov' * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package local_webhooks */ class event_observer { /** * Handler of all the events. * Each event is put into the job queue. * * @param object $event */ public static function observe_all($event) { $task = new \local_webhooks\task\process_events_task(); $task->set_custom_data($event->get_data()); \core\task\manager::queue_adhoc_task($task); } }