Lines Matching defs:event
41 * register a hook for an event
43 * @param string $event name used by the event
46 * @param string|callable $method event handler function
47 * @param mixed $param data passed to the event handler
50 public function register_hook($event, $advise, $obj, $method, $param = null, $seq = 0)
53 $doSort = !isset($this->hooks[$event . '_' . $advise][$seq]);
54 $this->hooks[$event . '_' . $advise][$seq][] = [$obj, $method, $param];
57 ksort($this->hooks[$event . '_' . $advise]);
62 * process the before/after event
64 * @param Event $event
67 public function process_event($event, $advise = '')
70 $evt_name = $event->name . ($advise ? '_' . $advise : '_BEFORE');
78 $method($event, $param);
80 $obj->$method($event, $param);
83 if (!$event->mayPropagate()) return;
90 * Check if an event has any registered handlers
95 * @param string $name Name of the event