• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/lib/network.php
  • Класс: BitrixSocialservicesNetwork
  • Вызов: Network::setEnable
public function setEnable($enable = true)
{
	if ($this->isOptionEnabled() && $enable)
		return true;

	if (!$this->isOptionEnabled() && !$enable)
		return true;

	$query = CBitrix24NetPortalTransport::init();
	if (!$query)
	{
		$this->errorCollection[] = new Error(Loc::getMessage('B24NET_SOCSERV_TRANSPORT_ERROR'), self::ERROR_SOCSERV_TRANSPORT);
		return false;
	}

	$queryResult = $query->call('feature.enable', array(
		'FEATURE' => 'replica',
		'STATUS' => (bool)$enable,
	));

	Option::set('socialservices', 'network_enable', $enable ? 'Y': 'N');

	return true;
}