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


PHP CCatalogStore::Update方法代码示例

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


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

示例1: CAdminList

$lAdmin = new CAdminList($sTableID, $oSort);
$arFilterFields = array();
$lAdmin->InitFilter($arFilterFields);
$arFilter = array();
if ($lAdmin->EditAction() && !$bReadOnly) {
    foreach ($_POST['FIELDS'] as $ID => $arFields) {
        $DB->StartTransaction();
        $ID = IntVal($ID);
        $arFields['ID'] = $ID;
        if (isset($arFields["IMAGE_ID"])) {
            unset($arFields["IMAGE_ID"]);
        }
        if (!$lAdmin->IsUpdated($ID)) {
            continue;
        }
        if (!CCatalogStore::Update($ID, $arFields)) {
            if ($ex = $APPLICATION->GetException()) {
                $lAdmin->AddUpdateError($ex->GetString(), $ID);
            } else {
                $lAdmin->AddUpdateError(GetMessage("ERROR_UPDATING_REC") . " (" . $arFields["ID"] . ", " . $arFields["TITLE"] . ", " . $arFields["SORT"] . ")", $ID);
            }
            $DB->Rollback();
        }
        $DB->Commit();
    }
}
if (($arID = $lAdmin->GroupAction()) && !$bReadOnly) {
    if ($_REQUEST['action_target'] == 'selected') {
        $arID = array();
        $dbResultList = CCatalogStore::GetList(array($_REQUEST["by"] => $_REQUEST["order"]));
        while ($arResult = $dbResultList->Fetch()) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:cat_store_list.php

示例2: ImportStores

 function ImportStores($XML_STORES_PARENT)
 {
     $ID = 0;
     $arXMLStores = $this->_xml_file->GetAllChildrenArray($XML_STORES_PARENT);
     foreach ($arXMLStores as $arXMLStore) {
         $arStore = array("TITLE" => $arXMLStore[$this->mess["IBLOCK_XML2_NAME"]], "XML_ID" => $arXMLStore[$this->mess["IBLOCK_XML2_ID"]]);
         if (isset($arXMLStore[$this->mess["IBLOCK_XML2_STORE_ADDRESS"]])) {
             $arStore["ADDRESS"] = $arXMLStore[$this->mess["IBLOCK_XML2_STORE_ADDRESS"]][$this->mess["IBLOCK_XML2_VIEW"]];
         }
         if (isset($arXMLStore[$this->mess["IBLOCK_XML2_STORE_DESCRIPTION"]])) {
             $arStore["DESCRIPTION"] = $arXMLStore[$this->mess["IBLOCK_XML2_STORE_DESCRIPTION"]];
         }
         if (isset($arXMLStore[$this->mess["IBLOCK_XML2_STORE_CONTACTS"]]) && is_array($arXMLStore[$this->mess["IBLOCK_XML2_STORE_CONTACTS"]])) {
             $storeContact = array();
             foreach ($arXMLStore[$this->mess["IBLOCK_XML2_STORE_CONTACTS"]] as $arContact) {
                 if (is_array($arContact)) {
                     $storeContact[] = $arContact[$this->mess["IBLOCK_XML2_VALUE"]];
                 }
             }
             if ($storeContact) {
                 $arStore["PHONE"] = implode(", ", $storeContact);
             }
         }
         $rsStore = CCatalogStore::GetList(array(), array("XML_ID" => $arXMLStore[$this->mess["IBLOCK_XML2_ID"]]));
         $arIDStore = $rsStore->Fetch();
         if (!$arIDStore) {
             $ID = CCatalogStore::Add($arStore);
         } else {
             $ID = CCatalogStore::Update($arIDStore["ID"], $arStore);
         }
     }
     if (!$ID) {
         return false;
     }
     return true;
 }
开发者ID:nycmic,项目名称:bittest,代码行数:36,代码来源:cml2.php

示例3: elseif

 if (strlen($isImage) == 0 && (strlen($arPREVIEW_PICTURE["name"]) > 0 || strlen($arPREVIEW_PICTURE["del"]) > 0)) {
     $fileId = CFile::SaveFile($arPREVIEW_PICTURE, "catalog");
 } elseif (strlen($isImage) > 0) {
     $errorMessage .= $isImage . "<br>";
 }
 $arFields = array("TITLE" => isset($_POST['TITLE']) ? $_POST['TITLE'] : '', "SORT" => isset($_POST['CSTORE_SORT']) ? (int) $_POST['CSTORE_SORT'] : 0, "ACTIVE" => isset($_POST['ACTIVE']) && $_POST['ACTIVE'] == 'Y' ? 'Y' : 'N', "ADDRESS" => isset($_POST['ADDRESS']) ? $_POST['ADDRESS'] : '', "DESCRIPTION" => isset($_POST['DESCRIPTION']) ? $_POST['DESCRIPTION'] : '', "GPS_N" => isset($_POST['GPS_N']) ? $_POST['GPS_N'] : '', "GPS_S" => isset($_POST['GPS_S']) ? $_POST['GPS_S'] : '', "PHONE" => isset($_POST['PHONE']) ? $_POST['PHONE'] : '', "SCHEDULE" => isset($_POST['SCHEDULE']) ? $_POST['SCHEDULE'] : '', "XML_ID" => isset($_POST['XML_ID']) ? $_POST['XML_ID'] : '', "USER_ID" => $userId, "MODIFIED_BY" => $userId, "EMAIL" => isset($_POST["EMAIL"]) ? $_POST["EMAIL"] : '', "ISSUING_CENTER" => $ISSUING_CENTER, "SHIPPING_CENTER" => $SHIPPING_CENTER, "SITE_ID" => $_POST["SITE_ID"]);
 $USER_FIELD_MANAGER->EditFormAddFields($entityId, $arFields);
 if (intval($fileId) > 0) {
     $arFields["IMAGE_ID"] = intval($fileId);
 } elseif ($fileId === "NULL") {
     $arFields["IMAGE_ID"] = "null";
 }
 $DB->StartTransaction();
 if ($errorMessage == '') {
     if ($id > 0) {
         $res = CCatalogStore::Update($id, $arFields);
     } else {
         $res = CCatalogStore::Add($arFields);
         if ($res) {
             $id = (int) $res;
         }
     }
     if (!$res) {
         if ($ex = $APPLICATION->GetException()) {
             $errorMessage .= $ex->GetString() . "<br>";
         } else {
             $errorMessage .= GetMessage('STORE_SAVE_ERROR') . '<br>';
         }
     } else {
         $ufUpdated = $USER_FIELD_MANAGER->Update($entityId, $id, $arFields);
     }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:cat_store_edit.php

示例4: ImportStores

	function ImportStores($XML_STORES_PARENT)
	{
		$this->next_step["XML_STORES_PARENT"] = $XML_STORES_PARENT;
		$ID = 0;
		$arXMLStores = $this->_xml_file->GetAllChildrenArray($XML_STORES_PARENT);
		foreach($arXMLStores as $arXMLStore)
		{
			$storeTitle = $arXMLStore[GetMessage("IBLOCK_XML2_NAME")];
			$storeAddress = (isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_ADDRESS")])) ? $arXMLStore[GetMessage("IBLOCK_XML2_STORE_ADDRESS")] : "";
			$storeDescription = (isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_DESCRIPTION")])) ? $arXMLStore[GetMessage("IBLOCK_XML2_STORE_DESCRIPTION")] : "";
			$storeContacts = (isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_CONTACTS")])) ? $arXMLStore[GetMessage("IBLOCK_XML2_STORE_CONTACTS")] : "";
			$rsStore = CCatalogStore::GetList(array(), array("XML_ID" => $arXMLStore[GetMessage("IBLOCK_XML2_ID")]));

			$arStore = array(
				"TITLE" => $storeTitle,
				"XML_ID" => $arXMLStore[GetMessage("IBLOCK_XML2_ID")],
				"ADDRESS" => $storeAddress,
				"DESCRIPTION" => $storeDescription,
				"PHONE" => $storeContacts,
			);
			$arIDStore = $rsStore->Fetch();
			if(!$arIDStore)
			{
				$ID = CCatalogStore::Add($arStore);
			}
			else
			{
				$ID = CCatalogStore::Update($arIDStore["ID"],$arStore);
			}
		}
		if(!$ID)
			return false;
		return true;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:34,代码来源:cml2.php

示例5: GetMessage

 if (trim($ADDRESS) == '') {
     $errorMessage .= GetMessage("ADDRESS_EMPTY") . "\n";
 }
 if (strlen($isImage) == 0 && (strlen($arPREVIEW_PICTURE["name"]) > 0 || strlen($arPREVIEW_PICTURE["del"]) > 0)) {
     $fileId = CFile::SaveFile($arPREVIEW_PICTURE, "catalog");
 } elseif (strlen($isImage) > 0) {
     $errorMessage .= $isImage . "\n";
 }
 $arFields = array("TITLE" => $TITLE, "ACTIVE" => $ACTIVE, "ADDRESS" => $ADDRESS, "DESCRIPTION" => $DESCRIPTION, "GPS_N" => $GPS_N, "GPS_S" => $GPS_S, "PHONE" => $PHONE, "SCHEDULE" => $SCHEDULE, "XML_ID" => $XML_ID, "USER_ID" => $userId, "MODIFIED_BY" => $userId);
 if (intval($fileId) > 0) {
     $arFields["IMAGE_ID"] = intval($fileId);
 } else {
     $arFields["IMAGE_ID"] = "null";
 }
 $DB->StartTransaction();
 if (strlen($errorMessage) == 0 && $ID > 0 && ($res = CCatalogStore::Update($ID, $arFields))) {
     $ID = $res;
     $DB->Commit();
     if (strlen($_REQUEST["apply"]) <= 0) {
         LocalRedirect("/bitrix/admin/cat_store_list.php?lang=" . LANG . "&" . GetFilterParams("filter_", false));
     } else {
         LocalRedirect("/bitrix/admin/cat_store_edit.php?lang=" . LANG . "&ID=" . $ID . "&" . GetFilterParams("filter_", false));
     }
 } elseif (strlen($errorMessage) == 0 && $ID == 0 && ($res = CCatalogStore::Add($arFields))) {
     $ID = $res;
     $DB->Commit();
     if (strlen($_REQUEST["apply"]) <= 0) {
         LocalRedirect("/bitrix/admin/cat_store_list.php?lang=" . LANG . "&" . GetFilterParams("filter_", false));
     } else {
         LocalRedirect("/bitrix/admin/cat_store_edit.php?lang=" . LANG . "&ID=" . $ID . "&" . GetFilterParams("filter_", false));
     }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:cat_store_edit.php

示例6: ImportStores

	public function ImportStores($XML_STORES_PARENT)
	{
		$this->next_step["XML_STORES_PARENT"] = $XML_STORES_PARENT;
		$ID = 0;
		$storeContact = array();
		$arXMLStores = $this->_xml_file->GetAllChildrenArray($XML_STORES_PARENT);
		foreach($arXMLStores as $arXMLStore)
		{
			$arStore = array(
				"TITLE" => $arXMLStore[GetMessage("IBLOCK_XML2_NAME")],
				"XML_ID" => $arXMLStore[GetMessage("IBLOCK_XML2_ID")],
			);
			if(isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_ADDRESS")]))
				$arStore["ADDRESS"] = $arXMLStore[GetMessage("IBLOCK_XML2_STORE_ADDRESS")][GetMessage("IBLOCK_XML2_VIEW")];
			if(isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_DESCRIPTION")]))
				$arStore["DESCRIPTION"] = $arXMLStore[GetMessage("IBLOCK_XML2_STORE_DESCRIPTION")];

			if(isset($arXMLStore[GetMessage("IBLOCK_XML2_STORE_CONTACTS")]) && is_array($arXMLStore[GetMessage("IBLOCK_XML2_STORE_CONTACTS")]))
			{
				foreach($arXMLStore[GetMessage("IBLOCK_XML2_STORE_CONTACTS")] as $arContact)
				{
					if(is_array($arContact))
					{
						$storeContact[] = $arContact[GetMessage("IBLOCK_XML2_VALUE")];
					}
				}
			}
			if(!empty($storeContact))
				$arStore["PHONE"] = implode(", ", $storeContact);

			$rsStore = CCatalogStore::GetList(array(), array("XML_ID" => $arXMLStore[GetMessage("IBLOCK_XML2_ID")]));
			$arIDStore = $rsStore->Fetch();
			if(!$arIDStore)
			{
				$ID = CCatalogStore::Add($arStore);
			}
			else
			{
				$ID = CCatalogStore::Update($arIDStore["ID"], $arStore);
			}
		}
		if(!$ID)
			return false;
		return true;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:45,代码来源:cml2.php

示例7: intval

		"EMAIL" => $_POST["EMAIL"],
		"ISSUING_CENTER" => $ISSUING_CENTER,
		"SHIPPING_CENTER" => $SHIPPING_CENTER,
		"SITE_ID" => $_POST["SITE_ID"]
	);

	$USER_FIELD_MANAGER->EditFormAddFields($entityId, $arFields);

	if (intval($fileId) > 0)
		$arFields["IMAGE_ID"] = intval($fileId);
	elseif ($fileId === "NULL")
		$arFields["IMAGE_ID"] = "null";

	$DB->StartTransaction();

	if (strlen($errorMessage) == 0 && ($res = CCatalogStore::Update($id, $arFields) || ($id == 0 && $res = CCatalogStore::Add($arFields))))
	{
		$id = $res;

		$ufUpdated = $USER_FIELD_MANAGER->Update($entityId, $id, $arFields);
		if ($ufUpdated)
			$DB->Query("UPDATE b_catalog_store SET DATE_MODIFY = ".$DB->CurrentTimeFunction()." WHERE ID = ".$id);

		$DB->Commit();

		if (strlen($_REQUEST["apply"]) <= 0)
			LocalRedirect("/bitrix/admin/cat_store_list.php?lang=".LANG."&".GetFilterParams("filter_", false));
		else
			LocalRedirect("/bitrix/admin/cat_store_edit.php?lang=".LANG."&ID=".$id."&".GetFilterParams("filter_", false));
	}
	else
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:31,代码来源:cat_store_edit.php


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