1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Params.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Message;
4
5use Bitrix\Main\ORM;
6use Bitrix\Main\Event;
7use Bitrix\Main\EventResult;
8use Bitrix\Im\Model\MessageParamTable;
9use Bitrix\Im\Model\EO_MessageParam;
10use Bitrix\Im\Model\EO_MessageParam_Collection;
11use Bitrix\Main\ArgumentTypeException;
12use Bitrix\Im\V2\Error;
13use Bitrix\Im\V2\Registry;
14use Bitrix\Im\V2\Message;
15use Bitrix\Im\V2\Result;
16
21class Params extends Registry
22{
23 public const EVENT_MESSAGE_PARAM_TYPE_INIT = 'OnMessageParamTypesInit';
24
25 public const
26 FILE_ID = 'FILE_ID',
27 ATTACH = 'ATTACH',
28 MENU = 'MENU',
29 KEYBOARD = 'KEYBOARD',
30 KEYBOARD_UID = 'KEYBOARD_UID',
31 IS_DELETED = 'IS_DELETED',
32 IS_ERROR = 'IS_ERROR',
33 IS_DELIVERED = 'IS_DELIVERED',
34 IS_EDITED = 'IS_EDITED',
35 IS_PINNED = 'IS_PINNED',
36 CAN_ANSWER = 'CAN_ANSWER',
37 URL_ONLY = 'URL_ONLY',
38 LARGE_FONT = 'LARGE_FONT',
39 SENDING = 'SENDING',
40 SENDING_TS = 'SENDING_TS',
41 USER_ID = 'USER_ID',
42 AVATAR = 'AVATAR',
43 NAME = 'NAME',
44 NOTIFY = 'NOTIFY',
45 CODE = 'CODE',
46 TYPE = 'TYPE',
47 COMPONENT_ID = 'COMPONENT_ID',
48 COMPONENT_PARAMS = 'COMPONENT_PARAMS',
49 STYLE_CLASS = 'CLASS',
50 CALL_ID = 'CALL_ID',
51 CHAT_ID = 'CHAT_ID',
52 CHAT_MESSAGE = 'CHAT_MESSAGE',
53 CHAT_USER = 'CHAT_USER',
54 DATE_TS = 'DATE_TS',
55 LIKE = 'LIKE',
56 FAVORITE = 'FAVORITE',
57 KEYBOARD_ACTION = 'KEYBOARD_ACTION',
58 URL_ID = 'URL_ID',
59 LINK_ACTIVE = 'LINK_ACTIVE',
60 USERS = 'USERS',
61 CHAT_LAST_DATE = 'CHAT_LAST_DATE',
62 DATE_TEXT = 'DATE_TEXT',
63 IS_ROBOT_MESSAGE = 'IS_ROBOT_MESSAGE',
64 FORWARD_ID = 'FORWARD_ID',
65 FORWARD_CONTEXT_ID = 'FORWARD_CONTEXT_ID',
66 FORWARD_USER_ID = 'FORWARD_USER_ID',
67 FORWARD_CHAT_TITLE = 'FORWARD_CHAT_TITLE',
68 REPLY_ID = 'REPLY_ID',
69 BETA = 'BETA',
70 COPILOT_PROMPT_CODE = 'COPILOT_PROMPT_CODE',
71 COPILOT_ROLE = 'COPILOT_ROLE'
72 ;
73
74 //todo: Move it into CRM module
75 public const
76 CRM_FORM_FILLED = 'CRM_FORM_FILLED',
77 CRM_FORM_ID = 'CRM_FORM_ID',
78 CRM_FORM_SEC = 'CRM_FORM_SEC'
79 ;
80
81 protected static bool $typeLoaded = false;
82
83 protected bool $isLoaded = false;
84
85 protected static array $typeMap = [
86 self::FILE_ID => [
87 'type' => Param::TYPE_INT_ARRAY,
88 ],
89 self::IS_DELETED => [
90 'type' => Param::TYPE_BOOL,
91 'default' => false,
92 ],
93 self::IS_ERROR => [
94 'type' => Param::TYPE_BOOL,
95 'default' => false,
96 ],
97 self::IS_DELIVERED => [
98 'type' => Param::TYPE_BOOL,
99 'default' => true,
100 ],
101 self::IS_EDITED => [
102 'type' => Param::TYPE_BOOL,
103 'default' => false,
104 ],
105 self::IS_PINNED => [
106 'type' => Param::TYPE_BOOL,
107 'default' => false,
108 ],
109 self::CAN_ANSWER => [
110 'type' => Param::TYPE_BOOL,
111 'default' => false,
112 ],
113 self::URL_ONLY => [
114 'type' => Param::TYPE_BOOL,
115 'default' => false,
116 ],
117 self::LARGE_FONT => [
118 'type' => Param::TYPE_BOOL,
119 'default' => false,
120 ],
121 self::ATTACH => [
122 'className' => \Bitrix\Im\V2\Message\Param\AttachArray::class,
123 'classItem' => \Bitrix\Im\V2\Message\Param\Attach::class,
124 'type' => Param::TYPE_JSON,
125 ],
126 self::MENU => [
127 'className' => \Bitrix\Im\V2\Message\Param\Menu::class,
128 'type' => Param::TYPE_JSON,
129 ],
130 self::KEYBOARD => [
131 'className' => \Bitrix\Im\V2\Message\Param\Keyboard::class,
132 'type' => Param::TYPE_JSON,
133 ],
134 self::KEYBOARD_UID => [
135 'type' => Param::TYPE_INT,
136 'default' => 0,
137 ],
138 self::SENDING => [
139 'type' => Param::TYPE_BOOL,
140 'default' => false,
141 ],
142 self::SENDING_TS => [
143 'type' => Param::TYPE_INT,
144 'default' => 0,
145 ],
146 // Message User
147 self::USER_ID => [
148 'type' => Param::TYPE_INT,
149 ],
150 self::AVATAR => [
151 'className' => \Bitrix\Im\V2\Message\Param\UserAvatar::class,
152 'type' => Param::TYPE_INT,
153 ],
154 self::NAME => [
155 'className' => \Bitrix\Im\V2\Message\Param\UserName::class,
156 'type' => Param::TYPE_STRING,
157 ],
158 // Disable notification for message
159 self::NOTIFY => [
160 'type' => Param::TYPE_BOOL,
161 ],
162 self::CODE => [
163 'type' => Param::TYPE_STRING,
164 'default' => '',
165 ],
166 self::TYPE => [
167 'type' => Param::TYPE_STRING,
168 'default' => '',
169 ],
170 self::COMPONENT_ID => [
171 'type' => Param::TYPE_STRING,
172 'default' => '',
173 ],
174 self::COMPONENT_PARAMS => [
175 'className' => Message\Param\ComponentParams::class,
176 'type' => Param::TYPE_JSON,
177 ],
178 self::STYLE_CLASS => [
179 'type' => Param::TYPE_STRING,
180 'default' => '',
181 ],
182 self::CALL_ID => [
183 'type' => Param::TYPE_INT,
184 'default' => 0,
185 ],
186 self::CHAT_ID => [
187 'type' => Param::TYPE_INT,
188 'default' => 0,
189 ],
190 self::CHAT_MESSAGE => [
191 'type' => Param::TYPE_INT,
192 'default' => 0,
193 ],
194 self::CHAT_USER => [
195 'type' => Param::TYPE_INT_ARRAY,
196 ],
197 self::DATE_TS => [
198 'type' => Param::TYPE_INT_ARRAY,
199 ],
200 self::LIKE => [
201 'type' => Param::TYPE_INT_ARRAY,
202 ],
203 self::FAVORITE => [
204 'type' => Param::TYPE_INT_ARRAY,
205 ],
206 self::KEYBOARD_ACTION => [
207 'type' => Param::TYPE_INT_ARRAY,
208 ],
209 self::URL_ID => [
210 'type' => Param::TYPE_INT_ARRAY,
211 ],
212 self::LINK_ACTIVE => [
213 'type' => Param::TYPE_INT_ARRAY,
214 ],
215 self::USERS => [
216 'type' => Param::TYPE_INT_ARRAY,
217 ],
218 self::CHAT_LAST_DATE => [
219 'type' => Param::TYPE_DATE_TIME,
220 ],
221 self::DATE_TEXT => [
222 'className' => \Bitrix\Im\V2\Message\Param\TextDate::class,
223 'type' => Param::TYPE_STRING_ARRAY,
224 ],
225 self::IS_ROBOT_MESSAGE => [
226 'type' => Param::TYPE_BOOL,
227 ],
228 self::FORWARD_ID => [
229 'type' => Param::TYPE_INT,
230 'isHidden' => true,
231 ],
232 self::FORWARD_USER_ID => [
233 'type' => Param::TYPE_INT,
234 'isHidden' => true,
235 ],
236 self::FORWARD_CONTEXT_ID => [
237 'type' => Param::TYPE_STRING,
238 'isHidden' => true,
239 ],
240 self::FORWARD_CHAT_TITLE => [
241 'type' => Param::TYPE_STRING,
242 'isHidden' => true,
243 ],
244 self::REPLY_ID => [
245 'type' => Param::TYPE_INT,
246 ],
247 self::BETA => [
248 'type' => Param::TYPE_BOOL,
249 'default' => false,
250 ],
251 self::COPILOT_PROMPT_CODE => [
252 'type' => Param::TYPE_STRING,
253 'isHidden' => true,
254 ],
255 self::COPILOT_ROLE => [
256 'type' => Param::TYPE_STRING,
257 'isHidden' => true,
258 ],
259
260 //todo: Move it into CRM module
261 self::CRM_FORM_FILLED => [
262 'type' => Param::TYPE_BOOL,
263 'default' => false,
264 ],
265 self::CRM_FORM_ID => [
266 'type' => Param::TYPE_STRING,
267 'default' => '',
268 ],
269 self::CRM_FORM_SEC => [
270 'type' => Param::TYPE_STRING,
271 'default' => '',
272 ],
273 ];
274
275
276 protected ?int $messageId = null;
277
279 protected array $droppedItems = [];
280
281 //region Types
282
288 public static function getType(string $paramName): array
289 {
290 self::initTypes();
291
292 if (isset(self::$typeMap[$paramName]))
293 {
294 $type = self::$typeMap[$paramName];
295 if (!isset($type['className']))
296 {
297 if ($type['type'] == Param::TYPE_INT_ARRAY || $type['type'] == Param::TYPE_STRING_ARRAY)
298 {
299 $type['className'] = ParamArray::class;
300 }
301 elseif ($type['type'] == Param::TYPE_DATE_TIME)
302 {
303 $type['className'] = Param\DateTime::class;
304 }
305 else
306 {
307 $type['className'] = Param::class;
308 }
309 }
310 }
311 else
312 {
313 $type = [
314 'className' => Param::class,
315 'type' => Param::TYPE_STRING,
316 ];
317 }
318
319 $type['isHidden'] ??= false;
320
321 return $type;
322 }
323
330 public static function addType(string $paramName, array $description): void
331 {
332 self::$typeMap[$paramName] = $description;
333 }
334
339 public static function initTypes(): void
340 {
341 if (!self::$typeLoaded)
342 {
343 $event = new Event('im', self::EVENT_MESSAGE_PARAM_TYPE_INIT);
344 $event->send();
345 $resultList = $event->getResults();
346
347 foreach ($resultList as $eventResult)
348 {
349 if ($eventResult->getType() === EventResult::SUCCESS)
350 {
351 $settings = $eventResult->getParameters();
352 if (is_array($settings))
353 {
354 foreach ($settings as $paramName => $description)
355 {
356 if (
357 is_array($description)
358 && (
359 !empty($description['type'])
360 || !empty($description['className'])
361 )
362 )
363 {
365 }
366 }
367 }
368 }
369 }
370 }
371
372 self::$typeLoaded = true;
373 }
374
375 //endregion
376
377 //region Loaders
378
383 public function isLoaded(): bool
384 {
385 return $this->isLoaded;
386 }
387
392 public function load($source): Result
393 {
394 if (is_array($source))
395 {
396 $result = $this->initByArray($source);
397 }
398 elseif ($source instanceof ORM\Objectify\Collection)
399 {
400 $result = $this->initByEntitiesCollection($source);
401 }
402 elseif ($source instanceof ORM\Objectify\EntityObject)
403 {
404 $result = $this->initByDataEntity($source);
405 }
406 else
407 {
408 $result = (new Result)->addError(new Error(Error::NOT_FOUND));
409 }
410
411 if ($result->isSuccess())
412 {
413 foreach ($this as $param)
414 {
415 if ($param->getMessageId())
416 {
417 $this->setMessageId($param->getMessageId());
418 break;
419 }
420 }
421
422 $this->isLoaded = true;
423 }
424
425 return $result;
426 }
427
433 {
434 if ($message->getMessageId())
435 {
436 return $this->loadByMessageId($message->getMessageId());
437 }
438
439 return new Result;
440 }
441
446 public function loadByMessageId(int $messageId): Result
447 {
448 if ($messageId > 0)
449 {
450 $this->setMessageId($messageId);
451
452 $collection = Param::getDataClass()::query()
453 ->setSelect(['ID', 'MESSAGE_ID', 'PARAM_NAME', 'PARAM_VALUE', 'PARAM_JSON'])
454 ->where('MESSAGE_ID', '=', $messageId)
455 ->fetchCollection()
456 ;
457
458 return $this->initByEntitiesCollection($collection);
459 }
460
461 return new Result;
462 }
463
468 protected function initByEntitiesCollection(ORM\Objectify\Collection $entitiesCollection): Result
469 {
471 foreach ($entitiesCollection as $entity)
472 {
473 $paramName = $entity->getParamName();
474 if (!parent::offsetExists($paramName))
475 {
476 $this[$paramName] = self::create($paramName);
477 }
478
479 $item = $this[$paramName];
480 if ($item instanceof ParamArray)
481 {
483 if (isset($type['classItem']))
484 {
485 $classItem = $type['classItem'];
486 $item->add(new $classItem($entity));
487 }
488 else
489 {
490 $item->add(new Param($entity));
491 }
492 }
493 else
494 {
495 $item->load($entity);
496 }
497 }
498
499 $this->isLoaded = true;
500
501 return new Result();
502 }
503
508 protected function initByArray(array $items): Result
509 {
510 foreach ($items as $entityId => $entity)
511 {
512 if (is_array($entity) && isset($entity['PARAM_NAME']))
513 {
514 $paramName = $entity['PARAM_NAME'];
515 if (!parent::offsetExists($paramName))
516 {
517 $this[$paramName] = self::create($paramName);
518 }
519
520 $item = $this[$paramName];
521 if ($item instanceof ParamArray)
522 {
524 if (isset($type['classItem']))
525 {
526 $classItem = $type['classItem'];
527 $item->add(new $classItem($entity));
528 }
529 else
530 {
531 $item->add(new Param($entity));
532 }
533 }
534 else
535 {
536 $item->load($entity);
537 }
538 }
539 else
540 {
541 if (!parent::offsetExists($entityId))
542 {
543 $this[$entityId] = self::create($entityId);
544 }
545
546 $this[$entityId]->setValue($entity);
547 }
548 }
549
550 return new Result();
551 }
552
558 {
559 $paramName = $entity->getParamName();
560 if (!parent::offsetExists($paramName))
561 {
562 $this[$paramName] = self::create($paramName);
563 }
564
565 $item = $this[$paramName];
566 if ($item instanceof ParamArray)
567 {
569 if (isset($type['classItem']))
570 {
571 $classItem = $type['classItem'];
572 $item->add(new $classItem($entity));
573 }
574 else
575 {
576 $item->add(new Param($entity));
577 }
578 }
579 else
580 {
581 $item->load($entity);
582 }
583
584 return new Result();
585 }
586
587 //endregion
588
589 //region Save
590
595 public function save(): Result
596 {
597 $result = new Result;
598
600 $entityCollectionClass = Param::getDataClass()::getCollectionClass();
601 $dataEntityCollection = new $entityCollectionClass;
602
603 $dropIds = [];
604
605 $itemKeyToUnset = [];
606 foreach ($this as $item)
607 {
608 if ($item->isDeleted())
609 {
610 $itemKeyToUnset[] = $item->getName();
611 continue;
612 }
613 if (!$item->hasValue())
614 {
615 continue;
616 }
617
618 if ($item instanceof Param)
619 {
620 $prepareResult = $item->prepareFields();
621 if ($prepareResult->isSuccess())
622 {
623 if ($prepareResult->getData()['SKIP_SAVE'] ?? false)
624 {
625 continue;
626 }
627 if ($item->isChanged())
628 {
629 $dataEntityCollection->add($item->getDataEntity());
630 $item->markChanged(false);
631 }
632 }
633 else
634 {
635 $result->addErrors($prepareResult->getErrors());
636 }
637 }
638 elseif ($item instanceof ParamArray)
639 {
640 $subItemKeyToUnset = [];
641 foreach ($item as $key => $subItem)
642 {
643 if ($subItem->isDeleted())
644 {
645 if ($subItem->getPrimaryId())
646 {
647 $dropIds[] = $subItem->getPrimaryId();
648 $subItemKeyToUnset[] = $key;
649 }
650 }
651 else
652 {
653 $prepareResult = $subItem->prepareFields();
654 if ($prepareResult->isSuccess())
655 {
656 if ($prepareResult->getData()['SKIP_SAVE'] ?? false)
657 {
658 continue;
659 }
660 if ($subItem->isChanged())
661 {
662 $dataEntityCollection->add($subItem->getDataEntity());
663 $subItem->markChanged(false);
664 }
665 }
666 else
667 {
668 $result->addErrors($prepareResult->getErrors());
669 }
670 }
671 }
672 $item->unsetByKeys($subItemKeyToUnset);
673 }
674 }
675 $this->unsetByKeys($itemKeyToUnset);
676
677 foreach ($this->droppedItems as $item)
678 {
679 if ($item instanceof Param)
680 {
681 if ($item->getPrimaryId())
682 {
683 $dropIds[] = $item->getPrimaryId();
684 }
685 }
686 elseif ($item instanceof ParamArray)
687 {
688 foreach ($item as $subItem)
689 {
690 if ($subItem->getPrimaryId())
691 {
692 $dropIds[] = $subItem->getPrimaryId();
693 }
694 }
695 }
696 }
697
698 $saveResult = $dataEntityCollection->save(true);
699 if ($saveResult->isSuccess())
700 {
701 if (!empty($dropIds))
702 {
703 MessageParamTable::deleteBatch(['=ID' => $dropIds]);
704 }
705
706 $this->droppedItems = [];
707 }
708 else
709 {
710 $result->addErrors($saveResult->getErrors());
711 }
712
713 return $result;
714 }
715
721 public function delete(): Result
722 {
723 $result = new Result;
724
725 $keysToUnset = [];
726 foreach ($this as $key => $item)
727 {
728 $keysToUnset[$key] = $key;
729 }
730 $this->unsetByKeys($keysToUnset);
731
732 if ($this->getMessageId())
733 {
734 $filter = [
735 '=MESSAGE_ID' => $this->getMessageId(),
736 ];
737
738 MessageParamTable::deleteBatch($filter);
739 }
740
741 $this->droppedItems = [];
742 $this->isLoaded = false;
743
744 return $result;
745 }
746
747 //endregion
748
749 //region Params get/set
750
757 public static function create(string $paramName): MessageParameter
758 {
760
761 if ($type['className'])
762 {
763 $paramClass = $type['className'];
764 }
765 else
766 {
767 $paramClass = Param::class;
768 }
769
770 return (new $paramClass)
771 ->setName($paramName)
772 ->setType($type['type'] ?? Param::TYPE_STRING)
773 ;
774 }
775
780 public function isSet(string $paramName): bool
781 {
782 return isset($this[$paramName])
783 && $this[$paramName]->hasValue()
784 && !$this[$paramName]->isDeleted()
785 ;
786 }
787
792 public function offsetExists($offset): bool
793 {
794 if (
795 !parent::offsetExists($offset)
796 && !$this->isLoaded()
797 && $this->getMessageId()
798 )
799 {
800 // lazyload
801 $this->loadByMessageId($this->getMessageId());
802 }
803
804 return parent::offsetExists($offset);
805 }
806
811 public function get(string $paramName): MessageParameter
812 {
813 if (!isset($this[$paramName]))// lazyload
814 {
815 $this[$paramName] = self::create($paramName);
816 }
817
818 return $this[$paramName];
819 }
820
826 public function set(string $paramName, $parameter): self
827 {
828 if ($parameter instanceof MessageParameter)
829 {
830 $this[$paramName] = $parameter;
831 }
832 else
833 {
834 $this[$paramName] = self::create($paramName);
835 $this[$paramName]->load($parameter);
836 }
837
838 if ($this->getMessageId())
839 {
840 $this[$paramName]->setMessageId($this->getMessageId());
841 }
842
843 return $this;
844 }
845
846 public function isValid(): Result
847 {
848 $result = new Result();
849
851 foreach ($this as $param)
852 {
853 $validParamResult = $param->isValid();
854 if (!$validParamResult->isSuccess())
855 {
856 $result->addErrors($validParamResult->getErrors());
857 }
858 }
859
860 return $result;
861 }
862
867 public function add(MessageParameter $parameter): self
868 {
869 $this[$parameter->getName()] = $parameter;
870
871 if ($this->getMessageId())
872 {
873 $parameter->setMessageId($this->getMessageId());
874 }
875
876 return $this;
877 }
878
887 public function offsetSet($offset, $entry): void
888 {
889 if (!($entry instanceof MessageParameter))
890 {
891 $entryClass = \get_class($entry);
892 throw new ArgumentTypeException("Entry is instance of {$entryClass}, but collection support MessageParameter");
893 }
894
895 if ($this->getMessageId())
896 {
897 $entry->setMessageId($this->getMessageId());
898 }
899
900 parent::offsetSet($offset, $entry);
901 }
902
907 public function remove(string $paramName = ''): self
908 {
909 if (empty($paramName))
910 {
911 $keysToUnset = [];
912 foreach ($this as $paramName => $param)
913 {
914 $keysToUnset[$paramName] = $paramName;
915 }
916 $this->unsetByKeys($keysToUnset);
917 $this->isLoaded = true;
918 }
919 else
920 {
921 unset($this[$paramName]);
922 }
923
924 return $this;
925 }
926
927 public function clear(): self
928 {
929 $keysToUnset = [];
930 foreach ($this as $paramName => $param)
931 {
932 $keysToUnset[$paramName] = $paramName;
933 }
934 $this->unsetByKeys($keysToUnset);
935
936 $this->droppedItems = [];
937 $this->isLoaded = true;
938
939 return $this;
940 }
941
946 public function offsetUnset($offset): void
947 {
948 if (parent::offsetExists($offset))
949 {
950 $this[$offset]->markDrop();
951 $this->droppedItems[] = $this[$offset];
952 }
953
954 parent::offsetUnset($offset);
955 }
956
961 public function setMessageId(int $messageId): self
962 {
963 $this->messageId = $messageId;
964 foreach ($this as $param)
965 {
966 $param->setMessageId($this->messageId);
967 }
968
969 return $this;
970 }
971
972 public function getMessageId(): ?int
973 {
974 return $this->messageId;
975 }
976
977 //endregion
978
979 public function toArray()
980 {
981 $result = [];
982 foreach ($this as $paramName => $param)
983 {
984 if ($param->hasValue())
985 {
986 $result[$paramName] = $param->toRestFormat();
987 }
988 }
989
990 return $result;
991 }
992
996 public function toRestFormat(): array
997 {
998 $result = [];
999 foreach ($this as $paramName => $param)
1000 {
1001 if ($param->hasValue() && !$param->isHidden())
1002 {
1003 $result[$paramName] = $param->toRestFormat();
1004 }
1005 }
1006
1007 return $result;
1008 }
1009
1013 public function toPullFormat(?array $extraParams = null): array
1014 {
1015 $result = [];
1016 foreach ($this as $paramName => $param)
1017 {
1018 if ($param->hasValue() && !$param->isHidden())
1019 {
1020 $result[$paramName] = $param->toPullFormat();
1021 }
1022 }
1023
1024 if (!isset($extraParams))
1025 {
1026 return $result;
1027 }
1028
1029 foreach ($extraParams as $extraParam)
1030 {
1031 if (!isset($result[$extraParam]))
1032 {
1033 $result[$extraParam] = Params::create($extraParam)->toPullFormat();
1034 }
1035 }
1036
1037 return $result;
1038 }
1039
1043 public function fill(array $values): self
1044 {
1045 foreach ($values as $paramName => $value)
1046 {
1047 $this->get($paramName)->setValue($value);
1048 }
1049
1050 return $this;
1051 }
1052
1053 public function __clone()
1054 {
1055 foreach ($this as $key => $param)
1056 {
1057 $this[$key] = clone $param;
1058 }
1059 }
1060}
$type
Определения options.php:106
if(! $messageFields||!isset($messageFields['message_id'])||!isset($messageFields['status'])||!CModule::IncludeModule("messageservice")) $messageId
Определения callback_ismscenter.php:26
string $paramName
Определения Params.php:48
initByDataEntity(ORM\Objectify\EntityObject $entity)
Определения Params.php:272
initByArray(array $items)
Определения Params.php:250
const NOT_FOUND
Определения Error.php:9
const CODE
Определения Params.php:45
const COPILOT_ROLE
Определения Params.php:71
const CALL_ID
Определения Params.php:50
const FAVORITE
Определения Params.php:56
offsetSet($offset, $entry)
Определения Params.php:887
const USERS
Определения Params.php:60
static array $typeMap
Определения Params.php:85
const FILE_ID
Определения Params.php:26
const IS_ROBOT_MESSAGE
Определения Params.php:63
const IS_ERROR
Определения Params.php:32
loadByMessage(Message $message)
Определения Params.php:432
offsetUnset($offset)
Определения Params.php:946
const NAME
Определения Params.php:43
offsetExists($offset)
Определения Params.php:792
const AVATAR
Определения Params.php:42
const IS_EDITED
Определения Params.php:34
bool $isLoaded
Определения Params.php:83
const REPLY_ID
Определения Params.php:68
const CRM_FORM_ID
Определения Params.php:77
const NOTIFY
Определения Params.php:44
static create(string $paramName)
Определения Params.php:757
static bool $typeLoaded
Определения Params.php:81
const USER_ID
Определения Params.php:41
const URL_ID
Определения Params.php:58
array $droppedItems
Определения Params.php:279
const IS_PINNED
Определения Params.php:35
const MENU
Определения Params.php:28
getMessageId()
Определения Params.php:972
isSet(string $paramName)
Определения Params.php:780
const LINK_ACTIVE
Определения Params.php:59
const FORWARD_CHAT_TITLE
Определения Params.php:67
const EVENT_MESSAGE_PARAM_TYPE_INIT
Определения Params.php:23
const DATE_TS
Определения Params.php:54
const KEYBOARD_UID
Определения Params.php:30
const CHAT_MESSAGE
Определения Params.php:52
const COPILOT_PROMPT_CODE
Определения Params.php:70
const IS_DELIVERED
Определения Params.php:33
const KEYBOARD
Определения Params.php:29
const KEYBOARD_ACTION
Определения Params.php:57
const FORWARD_CONTEXT_ID
Определения Params.php:65
const TYPE
Определения Params.php:46
load($source)
Определения Params.php:392
const ATTACH
Определения Params.php:27
const URL_ONLY
Определения Params.php:37
const CHAT_ID
Определения Params.php:51
initByDataEntity(ORM\Objectify\EntityObject $entity)
Определения Params.php:557
const SENDING
Определения Params.php:39
add(MessageParameter $parameter)
Определения Params.php:867
toPullFormat(?array $extraParams=null)
Определения Params.php:1013
loadByMessageId(int $messageId)
Определения Params.php:446
const CRM_FORM_SEC
Определения Params.php:78
setMessageId(int $messageId)
Определения Params.php:961
static getType(string $paramName)
Определения Params.php:288
static addType(string $paramName, array $description)
Определения Params.php:330
const SENDING_TS
Определения Params.php:40
const IS_DELETED
Определения Params.php:31
static initTypes()
Определения Params.php:339
const LIKE
Определения Params.php:55
fill(array $values)
Определения Params.php:1043
const CHAT_LAST_DATE
Определения Params.php:61
toRestFormat()
Определения Params.php:996
const BETA
Определения Params.php:69
const DATE_TEXT
Определения Params.php:62
const STYLE_CLASS
Определения Params.php:49
const CRM_FORM_FILLED
Определения Params.php:76
const COMPONENT_ID
Определения Params.php:47
int $messageId
Определения Params.php:276
const FORWARD_USER_ID
Определения Params.php:66
const CHAT_USER
Определения Params.php:53
const CAN_ANSWER
Определения Params.php:36
initByArray(array $items)
Определения Params.php:508
const COMPONENT_PARAMS
Определения Params.php:48
const FORWARD_ID
Определения Params.php:64
const LARGE_FONT
Определения Params.php:38
unsetByKeys(array $keys)
Определения Registry.php:11
Определения result.php:20
Определения error.php:15
getDataClass()
Определения entity.php:696
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
<?endfor;?> addType()
Определения options.php:1663
$result
Определения get_property_values.php:14
$entity
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
Определения .description.php:24
$filter
Определения iblock_catalog_list.php:54
Определения Uuid.php:3
$value
Определения Param.php:39
const TYPE_INT_ARRAY
Определения Param.php:22
setValue($value)
Определения Param.php:163
const TYPE_STRING
Определения Param.php:17
getType()
Определения Param.php:116
const TYPE_JSON
Определения Param.php:20
const TYPE_STRING_ARRAY
Определения Param.php:21
$entityId
Определения payment.php:4
$message
Определения payment.php:8
$settings
Определения product_settings.php:43
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
$items
Определения template.php:224