1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ActionMessageBuffer.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
8
10{
11 use InstanceTrait;
12
13 protected static array $stack = [];
14
15 public function put(ActionType $action, $collabId, $senderId, array $recipients = [], array $parameters = []): static
16 {
17 $key = "{$action->value}:{$collabId}:{$senderId}";
18 if (!isset(static::$stack[$key]))
19 {
20 static::$stack[$key] = [
21 'recipients' => [],
22 'parameters' => [],
23 ];
24 }
25
26 static::$stack[$key]['recipients'] = array_merge(static::$stack[$key]['recipients'], $recipients);
27 static::$stack[$key]['parameters'] = array_merge(static::$stack[$key]['parameters'], $parameters);
28
29 return $this;
30 }
31
32 public function flush(): void
33 {
34 $factory = ActionMessageFactory::getInstance();
35
36 foreach (static::$stack as $key => $data)
37 {
38 [$action, $collabId, $senderId] = explode(':', $key);
39
40 $recipients = $data['recipients'];
41 $parameters = $data['parameters'];
42
43 $factory
44 ->getActionMessage(ActionType::from($action), (int)$collabId, (int)$senderId)
45 ->send($recipients, $parameters);
46 }
47
48 static::$stack = [];
49 }
50}
put(ActionType $action, $collabId, $senderId, array $recipients=[], array $parameters=[])
Определения ActionMessageBuffer.php:15
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
trait InstanceTrait
Определения instancetrait.php:8
if(empty($signedUserToken)) $key
Определения quickway.php:257
$action
Определения file_dialog.php:21