• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Reaction/ReactionMessage.php
  • Класс: BitrixImV2MessageReactionReactionMessage
  • Вызов: ReactionMessage::toRestFormat
public function toRestFormat(array $option = []): array
{
	$converter = new Converter(Converter::KEYS | Converter::VALUES | Converter::TO_LOWER | Converter::LC_FIRST);
	$rest = [
		'messageId' => $this->messageId,
		'reactionCounters' => $converter->process($this->reactionCounters),
		'reactionUsers' => $converter->process($this->reactionUsers),
	];

	if (!isset($option['WITHOUT_OWN_REACTIONS']) || $option['WITHOUT_OWN_REACTIONS'] === false)
	{
		$rest['ownReactions'] = $converter->process($this->ownReactions);
	}

	return $rest;
}