• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/group_features_perms.php
  • Класс: CAllSocNetFeaturesPerms
  • Вызов: CAllSocNetFeaturesPerms::Delete
static function Delete($ID)
{
	global $DB, $CACHE_MANAGER;

	if (!CSocNetGroup::__ValidateID($ID))
		return false;

	$ID = intval($ID);
	$bSuccess = True;

	$db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetFeaturesPermsDelete");
	while ($arEvent = $db_events->Fetch())
		if (ExecuteModuleEventEx($arEvent, array($ID))===false)
			return false;

	$events = GetModuleEvents("socialnetwork", "OnSocNetFeaturesPermsDelete");
	while ($arEvent = $events->Fetch())
		ExecuteModuleEventEx($arEvent, array($ID));

	if ($bSuccess)
	{
		$bSuccess = $DB->Query("DELETE FROM b_sonet_features2perms WHERE ID = ".$ID."", true);
		if ($bSuccess)
		{
			if (defined("BX_COMP_MANAGED_CACHE"))
			{
				$CACHE_MANAGER->ClearByTag('sonet_features2perms');
				$CACHE_MANAGER->ClearByTag("sonet_features2perms_".$ID);
			}
			else
			{
				$dbGroupFeaturePerm = CSocNetFeaturesPerms::GetList(
					array(),
					array("ID" => $ID),
					false,
					false,
					array("FEATURE_ENTITY_TYPE", "FEATURE_ENTITY_ID")
				);
				if ($arGroupFeaturePerm = $dbGroupFeaturePerm->Fetch())
				{
					$cache = new CPHPCache;
					$cache->CleanDir(self::getCachePath($arGroupFeaturePerm['FEATURE_ENTITY_TYPE'], $arGroupFeaturePerm['FEATURE_ENTITY_ID']));
				}
			}
		}
	}

	return $bSuccess;
}