当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetLog::DeleteSystemEventsByGroupID方法代码示例

本文整理汇总了PHP中CSocNetLog::DeleteSystemEventsByGroupID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLog::DeleteSystemEventsByGroupID方法的具体用法?PHP CSocNetLog::DeleteSystemEventsByGroupID怎么用?PHP CSocNetLog::DeleteSystemEventsByGroupID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetLog的用法示例。


在下文中一共展示了CSocNetLog::DeleteSystemEventsByGroupID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Delete

 function Delete($ID)
 {
     global $DB;
     if (!CSocNetGroup::__ValidateID($ID)) {
         return false;
     }
     $ID = IntVal($ID);
     $bSuccess = True;
     $db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetGroupDelete");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     $arGroup = CSocNetGroup::GetByID($ID);
     if (!$arGroup) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_NO_GROUP"), "ERROR_NO_GROUP");
         return false;
     }
     $DB->StartTransaction();
     $events = GetModuleEvents("socialnetwork", "OnSocNetGroupDelete");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID));
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_user2group WHERE GROUP_ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $bSuccessTmp = true;
         $dbResult = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $ID, "ENTITY_TYPE" => SONET_ENTITY_GROUP));
         while ($arResult = $dbResult->Fetch()) {
             $bSuccessTmp = $DB->Query("DELETE FROM b_sonet_features2perms WHERE FEATURE_ID = " . $arResult["ID"] . "", true);
             if (!$bSuccessTmp) {
                 break;
             }
         }
         if (!$bSuccessTmp) {
             $bSuccess = false;
         }
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_features WHERE ENTITY_ID = " . $ID . " AND ENTITY_TYPE = '" . $DB->ForSql(SONET_ENTITY_GROUP, 1) . "'", true);
     }
     if ($bSuccess) {
         $dbResult = CSocNetLog::GetList(array(), array("ENTITY_ID" => $ID, "ENTITY_TYPE" => SONET_ENTITY_GROUP), false, false, array("ID"));
         while ($arResult = $dbResult->Fetch()) {
             $bSuccessTmp = $DB->Query("DELETE FROM b_sonet_log_site WHERE LOG_ID = " . $arResult["ID"] . "", true);
             if (!$bSuccessTmp) {
                 break;
             }
             $bSuccessTmp = $DB->Query("DELETE FROM b_sonet_log_right WHERE LOG_ID = " . $arResult["ID"] . "", true);
             if (!$bSuccessTmp) {
                 break;
             }
         }
         if (!$bSuccessTmp) {
             $bSuccess = false;
         }
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_log WHERE ENTITY_TYPE = '" . SONET_ENTITY_GROUP . "' AND ENTITY_ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $bSuccess = CSocNetLog::DeleteSystemEventsByGroupID($ID);
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_log_events WHERE ENTITY_TYPE = 'G' AND ENTITY_ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_group_site WHERE GROUP_ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sonet_log_right WHERE GROUP_CODE LIKE 'SG" . $ID . "\\_%' OR GROUP_CODE = 'SG" . $ID . "'", true);
     }
     if ($bSuccess) {
         $bSuccess = CSocNetSubscription::DeleteEx(false, "SG" . $ID);
     }
     if ($bSuccess) {
         CFile::Delete($arGroup["IMAGE_ID"]);
         $bSuccess = $DB->Query("DELETE FROM b_sonet_group WHERE ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         CUserOptions::DeleteOption("socialnetwork", "~menu_" . SONET_ENTITY_GROUP . "_" . $ID, false, 0);
         unset($GLOBALS["SONET_GROUP_CACHE"][$ID]);
     }
     if ($bSuccess) {
         $DB->Commit();
     } else {
         $DB->Rollback();
     }
     if ($bSuccess) {
         unset($GLOBALS["SONET_GROUP_CACHE"][$ID]);
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group_G" . $ID);
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group");
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group_" . $ID);
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group");
         }
     }
     if ($bSuccess && CModule::IncludeModule("search")) {
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:group.php


注:本文中的CSocNetLog::DeleteSystemEventsByGroupID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。