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


PHP CIBlockType::Delete方法代码示例

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


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

示例1: deleteIblockType

 public function deleteIblockType($typeId)
 {
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     if (\CIBlockType::Delete($typeId)) {
         return true;
     }
     $this->throwException(__METHOD__, 'Could not delete iblock type %s', $typeId);
 }
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:8,代码来源:IblockHelper.php

示例2: deleteIBlockType

 /**
  * @param string $id
  *
  * @throws MigrationException
  */
 protected function deleteIBlockType($id)
 {
     /** @global $APPLICATION \CMain */
     /** @global $DB \CDatabase */
     global $APPLICATION;
     global $DB;
     $DB->StartTransaction();
     if (\CIBlockType::Delete($id)) {
         $DB->Commit();
     } else {
         $DB->Rollback();
         throw new MigrationException($APPLICATION->GetException());
     }
 }
开发者ID:rocko61rus,项目名称:QuetzalTools,代码行数:19,代码来源:AbstractIBlockMigration.php

示例3: Delete

 /**
  * Delete
  * @param $IblockTypeCode
  * @return bool
  * @throws \Exception
  */
 public static function Delete($IblockTypeCode)
 {
     $Iblock = new \CIBlock();
     $iblockEl = new \CIBlockElement();
     $dbIblock = $Iblock->GetList(array(), array('TYPE' => $IblockTypeCode));
     while ($dbRow = $dbIblock->Fetch()) {
         $iblockElDbRes = $iblockEl->GetList(array(), array('IBLOCK_ID' => $dbRow['ID']));
         if ($iblockElDbRes !== false && $iblockElDbRes->SelectedRowsCount()) {
             throw new BimException('Can not delete iblock type: iblock id =' . $dbRow['ID'] . ' have elements');
         }
     }
     if (!\CIBlockType::Delete($IblockTypeCode)) {
         throw new BimException('Delete iblock type error!');
     }
     return true;
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:22,代码来源:IblockTypeIntegrate.php

示例4: while

}
if ($USER->IsAdmin() && ($arID = $lAdmin->GroupAction())) {
    if ($_REQUEST['action_target'] == 'selected') {
        $rsData = CIBlockType::GetList($arOrder, $arFilter);
        while ($arRes = $rsData->Fetch()) {
            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case "delete":
                $DB->StartTransaction();
                if (!CIBlockType::Delete($ID)) {
                    $DB->Rollback();
                    $lAdmin->AddGroupError(GetMessage("IBLOCK_TYPE_ADMIN_ERR_DEL") . " (&quot;" . htmlspecialcharsbx($ID) . "&quot;)", $ID);
                }
                $DB->Commit();
                break;
        }
    }
}
// Fill list with data
$rsData = CIBlockType::GetList($arOrder, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// Set page navigation
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("IBLOCK_TYPE_ADMIN_NAV")));
// List headers/columns
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:iblock_type_admin.php

示例5: removeSampleIblock

 /**
  *Удаляем установленный инфоблок с примерами. Его ID хранится в опции модуля demo_iblock_id
  */
 function removeSampleIblock()
 {
     global $DB;
     $iIblockId = intval(COption::GetOptionString("bit.includer", "demo_iblock_id", "0"));
     if ($iIblockId > 0 && CModule::IncludeModule('iblock')) {
         $res = CIBlock::GetByID($iIblockId);
         if ($arIblock = $res->GetNext()) {
             $DB->StartTransaction();
             if (!CIBlock::Delete($arIblock['ID'])) {
                 $DB->Rollback();
             } else {
                 $DB->Commit();
             }
             //Удаляем тип инфоблока если в нем нет других инфоблоков
             $res = CIBlock::GetList(array(), array('TYPE' => $arIblock['IBLOCK_TYPE_ID'], 'SITE_ID' => $arIblock['LID'], 'ACTIVE' => 'Y'), true);
             if (intval($res->SelectedRowsCount()) == 0) {
                 $DB->StartTransaction();
                 if (!CIBlockType::Delete($arIblock['IBLOCK_TYPE_ID'])) {
                     $DB->Rollback();
                 } else {
                     $DB->Commit();
                 }
             }
         }
     }
 }
开发者ID:ASDAFF,项目名称:bit.includer,代码行数:29,代码来源:index.php

示例6: UnInstallDB

	function UnInstallDB()
	{global $DB;
		if(CModule::IncludeModule("iblock"))
	{
		$DB->StartTransaction();
		if(!CIBlockType::Delete('vdk_companies_type'))
		{
			$DB->Rollback();
			echo 'Delete error!';
		}
		$DB->Commit();
	}
		if(CModule::IncludeModule("iblock"))
	{
		$DB->StartTransaction();
		if(!CIBlockType::Delete('vdk_cities_type'))
		{
			$DB->Rollback();
			echo 'Delete error!';
		}
		$DB->Commit();
	}
	
		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix.company,代码行数:25,代码来源:index.php

示例7: DoUninstall

	function DoUninstall()
	{
		if(!CModule::IncludeModule('iblock')) return false;
		
		global $APPLICATION, $step, $errors;

		$step = IntVal($step);
		if($step<2)
		{
			$APPLICATION->IncludeAdminFile(GetMessage("FORM_UNINSTALL_TITLE"), $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$this->MODULE_ID."/install/unstep1.php");
		}
		elseif($step==2)
		{
			$errors = false;
			if($_REQUEST["SAVE_IBLOCK"]!="Y"){
				CIBlockType::Delete("kaycom_ONEPLACESEO");
			}
			UnRegisterModule(self::MODULE_ID);
			$this->UnInstallDB();
			$this->UnInstallFiles();	
			UnRegisterModuleDependences("main", "OnEpilog", "kaycom.oneplaceseo",  "CKaycomOneplaceseo", "onPageLoad");
			
			$APPLICATION->IncludeAdminFile(GetMessage("FORM_UNINSTALL_TITLE"), $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$this->MODULE_ID."/install/unstep2.php");
		}
	}
开发者ID:akniyev,项目名称:itprom.ru,代码行数:25,代码来源:index.php

示例8: IblockTypeDelete

 /**
  * @param string $name
  * @param bool $deleteIfExists
  */
 protected function IblockTypeDelete($name)
 {
     $name = trim($name);
     if (empty($name)) {
         throw new \Exception('You must set iblock CODE');
     }
     global $DB;
     $DB->StartTransaction();
     if (!\CIBlockType::Delete($name)) {
         $DB->Rollback();
         $error = "Can't delete {$name} iblock type";
     } else {
         echo "Delete {$name} iblock type\r\n";
     }
     $DB->Commit();
     if (isset($error)) {
         throw new \Exception($error);
     }
 }
开发者ID:marvin255,项目名称:bxmigrate,代码行数:23,代码来源:Coded.php


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