44 public static function fromArray(array $array): self
47 $array[self::FIELD_TOKEN],
48 $array[self::FIELD_SECRET],
49 $array[self::FIELD_MAILBOX_ID],
50 $array[self::FIELD_MESSAGE_ID]
53 throw new \Bitrix\Main\SystemException(
'message access field error');
56 $item =
new self($array[self::FIELD_TOKEN], $array[self::FIELD_SECRET], (int)$array[self::FIELD_MAILBOX_ID], (
int)$array[self::FIELD_MESSAGE_ID]);
58 $item->entityType = $array[self::FIELD_ENTITY_TYPE] ??
'';
59 $item->entityId = (int)$array[self::FIELD_ENTITY_ID] ??
'';
60 $item->entityUfType = $array[self::FIELD_ENTITY_UF_TYPE] ??
'';
61 $item->entityUfId = (int)$array[self::FIELD_ENTITY_UF_ID] ??
'';
62 $item->options = $array[self::FIELD_ENTITY_OPTIONS] ??
'';
142 self::FIELD_TOKEN => $this->
getToken(),
143 self::FIELD_SECRET => $this->
getSecret(),
150 self::FIELD_ENTITY_OPTIONS => $this->
getOptions(),