• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/controller/contentview.php
  • Класс: BitrixSocialnetworkControllerContentView
  • Вызов: ContentView::getListAction
public function getListAction(array $params = []): ?array
{
	$contentId = (
		isset($params['contentId'])
		&& is_string($params['contentId'])
			? trim($params['contentId'])
			: ''
	);

	$page = (
		isset($params['page'])
		&& (int)$params['page'] > 0
			? (int)$params['page']
			: 1
	);

	$pathToUserProfile = (
		isset($params['pathToUserProfile'])
		&& is_string($params['pathToUserProfile'])
			? trim($params['pathToUserProfile'])
			: ''
	);

	if ($contentId === '')
	{
		$this->addError(new Error('Empty Content ID', 'SONET_CONTROLLER_CONTENTVIEW_EMPTY_CONTENT_ID'));
		return null;
	}

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

	$userList = UserContentView::getUserList([
		'contentId' => $contentId,
		'page' => $page,
		'pathToUserProfile' => $pathToUserProfile
	]);

	$result['items'] = $userList['items'];
	$result['itemsCount'] = count($result['items']);
	$result['hiddenCount'] = $userList['hiddenCount'];

	return $result;
}