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


PHP CPrice::CheckFields方法代码示例

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


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

示例1: Add

 function Add($arFields, $boolRecalc = false)
 {
     global $DB;
     if (!CPrice::CheckFields("ADD", $arFields, 0)) {
         return false;
     }
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true ? true : false;
     $events = GetModuleEvents("catalog", "OnBeforePriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array(&$arFields));
     }
     if (!empty($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
     }
     $arInsert = $DB->PrepareInsert("b_catalog_price", $arFields);
     $strSql = "INSERT INTO b_catalog_price(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = IntVal($DB->LastID());
     if ($ID > 0 && $boolBase == true) {
         CPrice::ReCountForBase($arFields);
     }
     $events = GetModuleEvents("catalog", "OnPriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     // strange copy-paste bug
     $events = GetModuleEvents("sale", "OnPriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:33,代码来源:price.php

示例2: Add

 function Add($arFields, $boolRecalc = false)
 {
     global $DB;
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true;
     foreach (GetModuleEvents("catalog", "OnBeforePriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arFields));
     }
     if (!CPrice::CheckFields("ADD", $arFields, 0)) {
         return false;
     }
     if (isset($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
         if (!$boolBase && $arFields['EXTRA_ID'] <= 0) {
             return false;
         }
     }
     $arInsert = $DB->PrepareInsert("b_catalog_price", $arFields);
     $strSql = "INSERT INTO b_catalog_price(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = (int) $DB->LastID();
     if ($ID > 0 && $boolBase) {
         CPrice::ReCountForBase($arFields);
     }
     foreach (GetModuleEvents("catalog", "OnPriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     // strange copy-paste bug
     foreach (GetModuleEvents("sale", "OnPriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:33,代码来源:price.php

示例3: Update

 function Update($ID, $arFields, $boolRecalc = false)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         return False;
     }
     if (!CPrice::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true ? true : false;
     $db_events = GetModuleEvents("catalog", "OnBeforePriceUpdate");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
             return false;
         }
     }
     if (!empty($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
     }
     $strUpdate = $DB->PrepareUpdate("b_catalog_price", $arFields);
     $strSql = "UPDATE b_catalog_price SET " . $strUpdate . " WHERE ID = " . $ID . " ";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($boolBase == true) {
         CPrice::ReCountForBase($arFields);
     }
     $events = GetModuleEvents("catalog", "OnPriceUpdate");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:33,代码来源:price.php

示例4: Update

	function Update($ID, $arFields,$boolRecalc = false)
	{
		global $DB;

		$ID = intval($ID);
		if ($ID <= 0)
			return false;

		$boolBase = false;
		$arFields['RECALC'] = ($boolRecalc === true ? true : false);

		foreach (GetModuleEvents("catalog", "OnBeforePriceUpdate", true) as $arEvent)
		{
			if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields))===false)
				return false;
		}

		if (!CPrice::CheckFields("UPDATE", $arFields, $ID))
			return false;

		if (isset($arFields['RECALC']) && $arFields['RECALC'] === true)
		{
			CPrice::ReCountFromBase($arFields, $boolBase);
			if (!$boolBase && 0 >= $arFields['EXTRA_ID'])
			{
				return false;
			}
		}

		$strUpdate = $DB->PrepareUpdate("b_catalog_price", $arFields);
		if (!empty($strUpdate))
		{
			$strSql = "UPDATE b_catalog_price SET ".$strUpdate." WHERE ID = ".$ID;
			$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		}

		if ($boolBase)
		{
			CPrice::ReCountForBase($arFields);
		}

		foreach (GetModuleEvents("catalog", "OnPriceUpdate", true) as $arEvent)
		{
			ExecuteModuleEventEx($arEvent, array($ID, $arFields));
		}

		return $ID;
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:48,代码来源:price.php


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