17 private $handlers = array();
31 $this->logger = $logger;
44 if (empty(
$name) || empty(
$type) || !is_callable($callback,
true)) {
48 if (!isset($this->handlers[
$name])) {
49 $this->handlers[
$name] = array();
80 if (isset($this->handlers[
$name]) && isset($this->handlers[
$name][
$type])) {
81 foreach ($this->handlers[
$name][
$type] as
$key => $name_callback) {
82 if ($name_callback == $callback) {
104 return $this->handlers;
133 $handlers = array_merge($handlers, array_values($this->handlers[
$name][
$type]));
136 if (isset($this->handlers[
'all'][
$type])) {
137 if (
$type !=
'all') {
138 $handlers = array_merge($handlers, array_values($this->handlers[
'all'][
$type]));
141 if (isset($this->handlers[
$name][
'all'])) {
142 if (
$name !=
'all') {
143 $handlers = array_merge($handlers, array_values($this->handlers[
$name][
'all']));
146 if (isset($this->handlers[
'all'][
'all'])) {
147 $handlers = array_merge($handlers, array_values($this->handlers[
'all'][
'all']));
if($guid==elgg_get_logged_in_user_guid()) $name
hasHandler($name, $type)
Does the hook have a handler?
unregisterHandler($name, $type, $callback)
Unregister a handler.
getOrderedHandlers($name, $type)
Returns an ordered array of handlers registered for $name and $type.
getAllHandlers()
Returns all registered handlers as array( $name => array( $type => array( $priority => callback,...
setLogger(\Elgg\Logger $logger=null)
Set a logger instance, e.g.
registerHandler($name, $type, $callback, $priority=500)
Registers a handler.