• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/livefeed/listsitem.php
  • Класс: BitrixSocialnetworkLivefeedListsItem
  • Вызов: ListsItem::initSourceFields
public function initSourceFields()
{
	static $cache = [];

	$elementId = $this->entityId;

	if ($elementId <= 0)
	{
		return;
	}

	if (isset($cache[$elementId]))
	{
		$logEntryFields = $cache[$elementId];
	}
	else
	{
		$res = self::$logTableClass::getList([
			'filter' => [
				'SOURCE_ID' => $elementId,
				'@EVENT_ID' => $this->getEventId(),
			],
			'select' => [ 'ID', 'TITLE', 'MESSAGE', 'TEXT_MESSAGE', 'PARAMS' ]
		]);

		$logEntryFields = $res->fetch();
		$cache[$elementId] = $logEntryFields;
	}

	if (empty($logEntryFields))
	{
		return;
	}

	$this->setLogId($logEntryFields['ID']);
	$this->setSourceFields($logEntryFields);
	$this->setSourceTitle($logEntryFields['TITLE']);

	$description = $logEntryFields['TEXT_MESSAGE'];
	$description = preg_replace('/(.*?)/is', '', $description);
	$description = CTextParser::clearAllTags($description);
	$this->setSourceDescription($description);
}