Elgg  Version 1.9
PluginHooksService.php
Go to the documentation of this file.
1 <?php
2 
15 
22  public function trigger($hook, $type, $params = null, $returnvalue = null) {
23  $hooks = $this->getOrderedHandlers($hook, $type);
24 
25  foreach ($hooks as $callback) {
26  if (!is_callable($callback)) {
27  if ($this->logger) {
28  $this->logger->warn("handler for plugin hook [$hook, $type] is not callable: "
29  . $this->describeCallable($callback));
30  }
31  continue;
32  }
33 
34  $args = array($hook, $type, $returnvalue, $params);
35  $temp_return_value = call_user_func_array($callback, $args);
36  if (!is_null($temp_return_value)) {
37  $returnvalue = $temp_return_value;
38  }
39  }
40 
41  return $returnvalue;
42  }
43 }
describeCallable($callable)
Get a string description of a callback.
$args
Some servers don&#39;t allow PHP to check the rewrite, so try via AJAX.
$params
Definition: login.php:72
$type
Definition: add.php:8
trigger($hook, $type, $params=null, $returnvalue=null)
Triggers a plugin hook.
getOrderedHandlers($name, $type)
Returns an ordered array of handlers registered for $name and $type.