• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/model/timeline.php
  • Класс: BitrixRpaModelTimeline
  • Вызов: Timeline::preparePublicData
public function preparePublicData(array $options = []): array
{
	$isWithFiles = (!isset($options['withFiles']) || $options['withFiles'] !== false);
	$converter = Converter::toJson();

	$fields = $this->collectValues();
	$data = $fields['DATA'] ?? null;
	$fields['TITLE'] = $this->getTitle();
	$fields = $converter->process($fields);
	$fields['data'] = $data;
	$fields['createdTimestamp'] = ($this->getCreatedTime()->getTimestamp() * 1000);

	if($this->getAction() === static::ACTION_COMMENT)
	{
		$parser = Comment::getCommentParser($isWithFiles ? $this->getId() : 0);
		$fields['htmlDescription'] = $parser->getHtml($fields['description']);
		$fields['textDescription'] = $parser->getText($fields['description']);
		$uiComment = Comment::getUiComment();
		$files = $uiComment->getFileUserFields($this->getId());
		if(isset($files[Comment::USER_FIELD_FILES]['VALUE']))
		{
			$fields['data']['files'] = $files[Comment::USER_FIELD_FILES]['VALUE'];
		}
	}
	$fields['users'] = Base::getUsers([$this->getUserId()]);

	return $fields;
}