public static function addCallback($hook, $order, $function) {
    $callback = array($order, $function);
    if (!isset(Hook::$hooks[$hook])) {
      Hook::$hooks[$hook] = array();
    }
    Hook::$hooks[$hook][] = $callback;
    uasort(Hook::$hooks[$hook], '\\SciActive\\Hook::sortCallbacks');
    return array_keys(Hook::$hooks[$hook], $callback);
  }
public static function addCallback($hook, $order, $function) {
    $callback = array($order, $function);
    if (!isset(Hook::$hooks[$hook])) {
      Hook::$hooks[$hook] = array();
    }
    Hook::$hooks[$hook][] = $callback;
    uasort(Hook::$hooks[$hook], '\\SciActive\\Hook::sortCallbacks');
    return array_keys(Hook::$hooks[$hook], $callback);
  }
public static function addCallback ( $ hook , $ order , $ function ) { $ callback = array ( $ order , $ function ) ; if ( ! isset ( Hook :: $ hooks [ $ hook ] ) ) { Hook :: $ hooks [ $ hook ] = array ( ) ; } Hook :: $ hooks [ $ hook ] [ ] = $ callback ; uasort ( Hook :: $ hooks [ $ hook ] , '\\SciActive\\Hook::sortCallbacks' ) ; return array_keys ( Hook :: $ hooks [ $ hook ] , $ callback ) ; }
Add a callback.

A callback is called either before a method runs or after. The callback
is passed an array of arguments or return value which it can freely
manipulate. If the callback runs before the method and sets the arguments
array to false (or causes an error), the method will not be run.
Callbacks before a method are passed the arguments given when the method
was called, while callbacks after a method are passed the return value
(in an array) of that method.

The callback can receive up to 5 arguments, in this order:

- &$arguments - An array of either arguments or a return value.
- $name - The name of the hook.
- &$object - The object on which the hook caught a method call.
- &$function - A callback for the method call which was caught. Altering
this will cause a different function/method to run.
- &$data - An array in which callbacks can store data to communicate with
later callbacks.

A hook is the name of whatever method it should catch. A hook can also
have an arbitrary name, but be wary that it may already exist and it may
result in your callback being falsely called. In order to reduce the
chance of this, always use a plus sign (+) and your component's name to
begin arbitrary hook names. E.g. "+com_games_player_bonus".

If the hook is called explicitly, callbacks defined to run before the
hook will run immediately followed by callbacks defined to run after.

A negative $order value means the callback will be run before the method,
while a positive value means it will be run after. The smaller the order
number, the sooner the callback will be run. You can think of the order
value as a timeline of callbacks, zero (0) being the actual method being
hooked.

Additional identical callbacks can be added in order to have a callback
called multiple times for one hook.

The hook "all" is a pseudo hook which will run regardless of what was
actually caught. Callbacks attached to the "all" hook will run before
callbacks attached to the actual hook.

Note: Be careful to avoid recursive callbacks, as they may result in an
infinite loop. All methods under $_ are automatically hooked.

@param string $hook The name of the hook to catch.
@param int $order The order can be negative, which will run before the method, or positive, which will run after the method. It cannot be zero.
@param callback The callback.
@return array An array containing the IDs of the new callback and all matching callbacks.
@uses \SciActive\Hook::sortCallbacks() To resort the callback array in the correct order.
Add a callback .