|
static | handleEvent (string $component, string $event, array $parameter) |
|
static | handleEvent (string $a_component, string $a_event, array $a_parameter) |
| Handle an event in a listener. More...
|
|
◆ __construct()
ilChatroomAppEventListener::__construct |
( |
ilDBInterface |
$database | ) |
|
|
private |
◆ cache()
ilChatroomAppEventListener::cache |
( |
Closure |
$proc | ) |
|
|
private |
@template A @template B
- Parameters
-
- Returns
- Closure(...A): B
Definition at line 69 of file class.ilChatroomAppEventListener.php.
69 : Closure
70 {
71 $cache = [];
72 return function (...$args) use (&$cache, $proc) {
73 $key = json_encode($args);
74 if (!isset($cache[$key])) {
75 $cache[$key] = $proc(...$args);
76 }
77 return $cache[$key];
78 };
79 }
Referenced by dbCachePrepare().
◆ dbCachePrepare()
- Returns
- Closure(string, array): Closure(array): void
Definition at line 54 of file class.ilChatroomAppEventListener.php.
54 : Closure
55 {
56 return $this->
cache(
function (...$args) use ($db): Closure {
57 $statement = $db->
prepare(...$args);
58 return fn(array $values = []) => $db->
execute($statement, $values);
59 });
60 }
cache(Closure $proc)
@template A @template B
execute(ilDBStatement $stmt, array $data=[])
prepare(string $a_query, ?array $a_types=null, ?array $a_result_types=null)
Prepare a query (SELECT) statement to be used with execute.
References cache(), ilDBInterface\execute(), and ilDBInterface\prepare().
Referenced by __construct().
◆ handle()
ilChatroomAppEventListener::handle |
( |
string |
$component, |
|
|
string |
$event, |
|
|
array |
$parameter |
|
) |
| |
|
private |
Definition at line 44 of file class.ilChatroomAppEventListener.php.
44 : void
45 {
46 if ($event === 'deleteUser') {
47 $this->clean_up->removeEntriesOfDeletedUser($parameter['usr_id']);
48 }
49 }
◆ handleEvent()
static ilChatroomAppEventListener::handleEvent |
( |
string |
$component, |
|
|
string |
$event, |
|
|
array |
$parameter |
|
) |
| |
|
static |
◆ $clean_up
readonly CleanUpBans ilChatroomAppEventListener::$clean_up |
|
private |
◆ $instance
The documentation for this class was generated from the following file: