當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HighloadBlockTable::delete方法代碼示例

本文整理匯總了PHP中Bitrix\Highloadblock\HighloadBlockTable::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP HighloadBlockTable::delete方法的具體用法?PHP HighloadBlockTable::delete怎麽用?PHP HighloadBlockTable::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Bitrix\Highloadblock\HighloadBlockTable的用法示例。


在下文中一共展示了HighloadBlockTable::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
         // remove user data
         CModule::IncludeModule("highloadblock");
         $result = \Bitrix\Highloadblock\HighloadBlockTable::getList();
         while ($hldata = $result->fetch()) {
             \Bitrix\Highloadblock\HighloadBlockTable::delete($hldata['ID']);
         }
         // remove hl system data
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/highloadblock/install/db/" . strtolower($DB->type) . "/uninstall.sql");
     }
     UnRegisterModule("highloadblock");
     UnRegisterModuleDependences("main", "OnBeforeUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeAdd");
     UnRegisterModuleDependences("main", "OnAfterUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "onAfterUserTypeAdd");
     UnRegisterModuleDependences("main", "OnBeforeUserTypeDelete", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeDelete");
     UnRegisterModuleDependences('main', 'OnUserTypeBuildList', 'highloadblock', 'CUserTypeHlblock', 'GetUserTypeDescription');
     UnRegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'highloadblock', 'CIBlockPropertyDirectory', 'GetUserTypeDescription');
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     }
     return true;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:26,代碼來源:index.php

示例2: deleteHlblock

 public function deleteHlblock($hlblockId)
 {
     $result = HL\HighloadBlockTable::delete($hlblockId);
     if ($result->isSuccess()) {
         return true;
     }
     $this->throwException(__METHOD__, implode(', ', $result->getErrors()));
 }
開發者ID:andreyryabin,項目名稱:sprint.migration,代碼行數:8,代碼來源:HlblockHelper.php

示例3: array

if ($is_create_form) {
    // default values for create form
    $hlblock = array_fill_keys(array('ID', 'NAME', 'TABLE_NAME'), '');
    // page title
    $APPLICATION->SetTitle(GetMessage('HLBLOCK_ADMIN_ENTITY_EDIT_PAGE_TITLE_NEW'));
} else {
    $APPLICATION->SetTitle(GetMessage('HLBLOCK_ADMIN_ENTITY_EDIT_PAGE_TITLE_EDIT', array('#NAME#' => $hlblock['NAME'])));
    $entity = HL\HighloadBlockTable::compileEntity($hlblock);
    $entity_data_class = $entity->getDataClass();
    $entity_table_name = $hlblock['TABLE_NAME'];
    $hlblock['ROWS_COUNT'] = $entity_data_class::getCount();
}
$isEditMode = true;
// delete action
if ($is_update_form && isset($_REQUEST['action']) && $_REQUEST['action'] === 'delete' && check_bitrix_sessid()) {
    HL\HighloadBlockTable::delete($hlblock['ID']);
    LocalRedirect("highloadblock_index.php?lang=" . LANGUAGE_ID);
}
// save action
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && check_bitrix_sessid()) {
    $data = array('NAME' => trim($_REQUEST['NAME']), 'TABLE_NAME' => trim($_REQUEST['TABLE_NAME']));
    if ($is_update_form) {
        $ID = intval($_REQUEST['ID']);
        $result = HL\HighloadBlockTable::update($ID, $data);
    } else {
        // create
        $result = HL\HighloadBlockTable::add($data);
        $ID = $result->getId();
    }
    if ($result->isSuccess()) {
        if (strlen($save) > 0) {
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:31,代碼來源:highloadblock_entity_edit.php

示例4: Delete

 /**
  * Delete
  * @param $entityName
  * @return bool
  * @throws \Exception
  */
 public static function Delete($entityName)
 {
     $userType = new \CUserTypeEntity();
     if (!strlen($entityName)) {
         throw new BimException('Incorrect entityName param value');
     }
     $filter = array('NAME' => $entityName);
     $hlBlockDbRes = HL\HighloadBlockTable::getList(array("filter" => $filter));
     if (!$hlBlockDbRes->getSelectedRowsCount()) {
         throw new BimException('Not found highloadBlock with entityName = ' . $entityName);
     }
     $hlBlockRow = $hlBlockDbRes->fetch();
     $entity = HL\HighloadBlockTable::compileEntity($hlBlockRow);
     $entityDataClass = $entity->getDataClass();
     $obList = $entityDataClass::getList();
     if ($obList->getSelectedRowsCount() > 0) {
         throw new BimException('Unable to remove a highloadBlock[' . $entityName . '], because it has elements');
     }
     # delete all Fields
     $obHl = $userType->GetList(array(), array("ENTITY_ID" => "HLBLOCK_" . $hlBlockRow['ID']));
     while ($arHl = $obHl->Fetch()) {
         $obUF = new \CUserTypeEntity();
         $obUF->Delete($arHl['ID']);
     }
     $delResult = HL\HighloadBlockTable::delete($hlBlockRow['ID']);
     if (!$delResult->isSuccess()) {
         throw new BimException(implode(", ", $delResult->getErrorMessages()));
     }
     return true;
 }
開發者ID:cjp2600,項目名稱:bim-core,代碼行數:36,代碼來源:HighloadblockIntegrate.php


注:本文中的Bitrix\Highloadblock\HighloadBlockTable::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。