-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathHooks.php
More file actions
39 lines (35 loc) · 1.15 KB
/
Copy pathHooks.php
File metadata and controls
39 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace FeatherBB\Core\Interfaces;
class Hooks extends SlimSugar
{
/**
* Invoke hook
* @param string $name The hook name
* @param mixed ... (Optional) Argument(s) for hooked functions, can specify multiple arguments
* @return mixed data
*/
public static function fire($name)
{
return call_user_func_array([static::$slim->getContainer()['hooks'], 'fire'], func_get_args());
}
/**
* Invoke hook for DB
* @param string $name The hook name
* @param mixed ... Argument(s) for hooked functions, can specify multiple arguments
* @return mixed
*/
public static function fireDB($name)
{
return call_user_func_array([static::$slim->getContainer()['hooks'], 'fireDB'], func_get_args());
}
/**
* Assign hook
* @param string $name The hook name
* @param mixed $callable A callable object
* @param int $priority The hook priority; 0 = high, 10 = low
*/
public static function bind($name, $callable, $priority = 10)
{
return static::$slim->getContainer()['hooks']->bind($name, $callable, $priority);
}
}