1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
PullTransport.php
См. документацию.
1<?php
2
3namespace Bitrix\Rest;
4
5use Bitrix\Bitrix24\CurrentUser;
6use Bitrix\Main\Loader;
7use Bitrix\Main\LoaderException;
8use Bitrix\Pull\Event;
9
11{
16 private array $recipients;
17 private string $moduleId;
18 private int $expiry;
19
24 public function __construct(array $userIds = null, int $expiry = 0)
25 {
26 if (!Loader::includeModule('pull'))
27 {
28 throw new \Exception('Module "pull" not installed');
29 }
30
31 if (is_null($userIds))
32 {
33 $this->recipients = [CurrentUser::get()->getId()];
34 }
35 else
36 {
37 $this->recipients = $userIds;
38 }
39 $this->moduleId = 'rest';
40 $this->expiry = $expiry;
41 }
42
43 public function send(string $method, array $parameters): bool
44 {
45 return Event::add($this->recipients, [
46 'module_id' => $this->moduleId,
47 'command' => $method,
48 'params' => $parameters,
49 'expiry' => $this->expiry,
50 ]
51 );
52 }
53}
add($name, $value)
Определения configuration.php:141
send(string $method, array $parameters)
Определения PullTransport.php:43
__construct(array $userIds=null, int $expiry=0)
Определения PullTransport.php:24
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$method
Определения index.php:27