• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Link/BaseLinkItem.php
  • Класс: BitrixImV2LinkBaseLinkItem
  • Вызов: BaseLinkItem::toRestFormat
public function toRestFormat(array $option = []): array
{
	$startId = Chat::getInstance($this->getChatId())->getStartId();

	return [
		'id' => $this->getPrimaryId(),
		'messageId' => ($this->getMessageId() >= $startId) ? $this->getMessageId() : 0,
		'chatId' => $this->getChatId(),
		'authorId' => $this->getAuthorId(),
		'dateCreate' => $this->getDateCreate()->format('c'),
		static::getEntityClassName()::getRestEntityName() => $this->getEntity()->toRestFormat($option),
	];
}