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


PHP CIBlockPropertyEnum::Delete方法代码示例

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


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

示例1: UpdatePropertyList

 public static function UpdatePropertyList($prop_id, $list)
 {
     foreach ($list as $id => $arEnum) {
         $value = trim($arEnum["VALUE"], " \t\n\r");
         if (strlen($value)) {
             $dbEnum = CIBlockPropertyEnum::GetByID($id);
             if (is_array($dbEnum)) {
                 $def = isset($arEnum["DEF"]) ? $arEnum["DEF"] : $dbEnum["DEF"];
                 $sort = intval($arEnum["SORT"]);
                 if ($dbEnum["VALUE"] != $value || $dbEnum["SORT"] != $sort || $dbEnum["DEF"] != $def) {
                     $dbEnum["VALUE"] = $value;
                     $dbEnum["SORT"] = $sort;
                     $dbEnum["DEF"] = $def;
                     unset($dbEnum["ID"]);
                     CIBlockPropertyEnum::Update($id, $dbEnum);
                 }
             } else {
                 $arEnum["PROPERTY_ID"] = $prop_id;
                 CIBlockPropertyEnum::Add($arEnum);
             }
         } else {
             CIBlockPropertyEnum::Delete($id);
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:list.php

示例2: Array

						"arProducts" => $arProducts
						);
			}

			if ('N' == $keepExistingProperties)
			{
				$res = CIBlockProperty::GetList(array(), Array("IBLOCK_ID"=>$IBLOCK_ID, "!TMP_ID"=>$tmpid));
				while($arr = $res->Fetch())
				{
					CIBlockProperty::Delete($arr["ID"]);
				}

				$res = CIBlockPropertyEnum::GetList(array(), Array("IBLOCK_ID"=>$IBLOCK_ID, "!TMP_ID"=>$tmpid));
				while($arr = $res->Fetch())
				{
					CIBlockPropertyEnum::Delete($arr["ID"]);
				}
			}

			if ($outFileAction!="F")
			{
				$bs = new CIBlockSection;
				$res = CIBlockSection::GetList(array(), Array("IBLOCK_ID"=>$IBLOCK_ID, "!TMP_ID"=>$tmpid));
				while($arr = $res->Fetch())
				{
					if ($outFileAction!="H")
					{
						CIBlockSection::Delete($arr["ID"]);
					}
					else
					{
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:31,代码来源:commerceml_run.php

示例3: process

 /**
  *
  */
 public function process()
 {
     if ($this->processed) {
         return;
     }
     $this->processed = true;
     foreach ($this->generateData() as $k => $v) {
         $this->data[$k] = $v;
     }
     $this->update();
     $o = new \CIBlock();
     $mesages = $this->messages();
     $o->SetMessages($this->getId(), $mesages);
     $fields = $this->fields();
     $o->SetFields($this->getId(), $fields);
     $props = $this->loadProperties();
     $newProps = $this->properties();
     foreach ($this->urlsProps() as $key => $data) {
         $newProps[$key] = $data;
     }
     $o = new \CIBlockProperty();
     foreach ($props as $prop => $data) {
         if (!isset($newProps[$prop])) {
             $o->Delete($data['ID']);
         }
     }
     foreach ($newProps as $prop => $data) {
         $data['CODE'] = $prop;
         if ($data['PROPERTY_TYPE'] == 'E' || $data['PROPERTY_TYPE'] == 'G') {
             if (!isset($data['LINK_IBLOCK_ID'])) {
                 if (isset($data['LINK_IBLOCK_CODE'])) {
                     $data['LINK_IBLOCK_ID'] = self::codeToId($data['LINK_IBLOCK_CODE']);
                 }
             }
         }
         if (isset($props[$prop])) {
             $id = $props[$prop]['ID'];
             $o->Update($id, $data);
         } else {
             $data['IBLOCK_ID'] = $this->getId();
             $id = $o->Add($data);
         }
         if ($data['PROPERTY_TYPE'] == 'L' && isset($data['ITEMS']) && is_array($data['ITEMS'])) {
             $items = array();
             $newItems = $data['ITEMS'];
             $res = \CIBlockPropertyEnum::GetList(array(), array('PROPERTY_ID' => $id, 'CHECK_PERMISSIONS' => 'N'));
             while ($row = $res->Fetch()) {
                 $iid = $row['ID'];
                 $eid = $row['EXTERNAL_ID'];
                 if (!isset($newItems[$eid])) {
                     \CIBlockPropertyEnum::Delete($iid);
                 } else {
                     $items[$eid] = $row;
                 }
             }
             $eo = new \CIBlockPropertyEnum();
             foreach ($newItems as $eid => $edata) {
                 if (is_string($edata)) {
                     $edata = array('VALUE' => $edata);
                 }
                 $edata['PROPERTY_ID'] = $id;
                 $edata['EXTERNAL_ID'] = $eid;
                 $edata['XML_ID'] = $eid;
                 if (isset($items[$eid])) {
                     $eo->Update($items[$eid]['ID'], $edata);
                 } else {
                     $eo->Add($edata);
                 }
             }
         }
     }
 }
开发者ID:techart,项目名称:bitrix.tao,代码行数:75,代码来源:infoblock.php


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