1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
pull.php
См. документацию.
1<?php
2
4
7
8class Pull
9{
10 public const TAG = 'MESSAGESERVICE';
11 public const COMMAND = 'message_update';
12
13 private static $canUse;
14
15 public static function canUse()
16 {
17 if (static::$canUse === null)
18 {
19 static::$canUse = Loader::includeModule('pull');
20 }
21 return static::$canUse;
22 }
23
24 public static function onMessagesUpdate(array $messages)
25 {
26 if (!static::canUse())
27 {
28 return false;
29 }
30
31 return static::addToStack(
32 self::COMMAND,
33 [
34 'messages' => static::convertData($messages)
35 ]
36 );
37 }
38
44 private static function addToStack($command, array $params)
45 {
46 if (!static::canUse())
47 {
48 return false;
49 }
50
51 return \CPullWatch::addToStack(
52 self::TAG,
53 array(
54 'module_id' => 'messageservice',
55 'command' => $command,
56 'params' => $params,
57 )
58 );
59 }
60
67 private static function convertData(array $messages): array
68 {
69 foreach($messages as $k => $message)
70 {
71 foreach ($message as $field => $value)
72 {
73 if ($value instanceof DateTime)
74 {
75 $messages[$k][$field] = (string)$value;
76 }
77 }
78 }
79
80 return $messages;
81 }
82}
Определения loader.php:13
static onMessagesUpdate(array $messages)
Определения pull.php:24
static canUse()
Определения pull.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$message
Определения payment.php:8
$messages
Определения template.php:8
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$k
Определения template_pdf.php:567