• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/connector/socialnetwork.php
  • Класс: BitrixLandingConnectorSocialNetwork
  • Вызов: SocialNetwork::getBindingRow
static function getBindingRow(int $groupId, bool $checkAccess = true)
{
	BitrixLandingSiteType::setScope(
		BitrixLandingSiteType::SCOPE_CODE_GROUP
	);

	$groupId = intval($groupId);
	$bindings = BindingGroup::getList($groupId);

	if ($bindings)
	{
		$bindings = array_pop($bindings);

		if ($bindings['ENTITY_TYPE'] == BindingEntity::ENTITY_TYPE_SITE)
		{
			$hasAccess = !$checkAccess || Rights::hasAccessForSite(
				$bindings['ENTITY_ID'],
				Rights::ACCESS_TYPES['read']
			);
			if ($hasAccess)
			{
				return $bindings;
			}
		}
	}

	return [];
}