• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/controller/livefeed/logentry.php
  • Класс: BitrixSocialnetworkControllerLivefeedLogEntry
  • Вызов: LogEntry::pinAction
public function pinAction(array $params = []): ?array
{
	$logId = (int)($params['logId'] ?? 0);

	if ($logId <= 0)
	{
		$this->addError(new Error('Empty Log ID.', 'SONET_CONTROLLER_LIVEFEED_LOGENTRY_EMPTY_LOG_ID'));
		return null;
	}

	if (!Loader::includeModule('socialnetwork'))
	{
		$this->addError(new Error('Cannot include Socialnetwork module.', 'SONET_CONTROLLER_LIVEFEED_LOGENTRY_MODULE_NOT_INSTALLED'));
		return null;
	}

	LogPinnedTable::set([
		'logId' => $logId,
		'userId' => (int)$this->getCurrentUser()->getId(),
	]);

	return [
		'success' => true
	];
}