19 $instance =
new static();
20 $instance->userList = $arrayFields[
'users'] ?? [];
21 $instance->channelList = $arrayFields[
'channels'] ?? [];
23 $body = $arrayFields[
'event'];
24 if (is_array(
$body[
'user_params']) && !empty(
$body[
'user_params']))
26 $instance->userParams = $arrayFields[
'event'][
'user_params'];
28 if (is_array(
$body[
'dictionary']) && !empty(
$body[
'dictionary']))
30 $instance->dictionary = $arrayFields[
'event'][
'dictionary'];
32 $instance->expiry = is_int(
$body[
'expiry']) &&
$body[
'expiry'] > 0 ?
$body[
'expiry'] : 86400;
34 $messageType =
"{$body['module_id']}_{$body['command']}";
35 $messageType = preg_replace(
"/[^\w]/",
"", $messageType);
36 $instance->type = $messageType;
38 unset(
$body[
'user_params']);
39 unset(
$body[
'dictionary']);
40 unset(
$body[
'expiry']);
42 $instance->body =
$body;