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


PHP API::create方法代码示例

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


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

示例1: create

 /**
  * Create a new item in the database
  *
  * @return mixed false if failed to create, the id of the item otherwise
  */
 function create()
 {
     $_POST['catparentlist'] = '';
     $_POST['catviews'] = 0;
     //if (!$this->CategoryExists($_POST['catparentid'], $_POST['catname'])) {
     if (!$this->CategoryExists($_POST['catparentid'], $_POST['catname']) && !$GLOBALS['ISC_CLASS_ADMIN_CATEGORY']->BrandSeriesDuplicationExists($_POST['catname'])) {
         //Commented & Changed by Simha
         $CatId = parent::create();
         // If the save was successful, build the parent list
         if ($CatId) {
             $parentList = $this->BuildParentList($CatId);
             $updatedCategory = array("catparentlist" => $parentList);
             $GLOBALS['ISC_CLASS_DB']->UpdateQuery("categories", $updatedCategory, "categoryid='" . $GLOBALS['ISC_CLASS_DB']->Quote($CatId) . "'");
         }
         // If the category doesn't have a parent, rebuild the root categories cache
         if ($_POST['catparentid'] == 0) {
             $GLOBALS['ISC_CLASS_DATA_STORE']->UpdateRootCategories();
         }
         // Rebuild the group pricing caches
         $GLOBALS['ISC_CLASS_DATA_STORE']->UpdateCustomerGroupsCategoryDiscounts();
         return $CatId;
     } else {
         //$this->error = sprintf(GetLang('apiCatAlreadyExists'), $_POST['catname']);
         $this->error = sprintf(GetLang('NameAlreadyExists'), $_POST['catname']);
         //Commented and changed by Simha
         return false;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:33,代码来源:category.api.php

示例2: create

 /**
  * Create a new item in the database
  *
  * @return mixed false if failed to create, the id of the item otherwise
  */
 function create()
 {
     $_POST['couponminpurchase'] = (int) $_POST['couponminpurchase'];
     if ($this->CouponExists($_POST['couponcode']) < 1) {
         return parent::create();
     } else {
         $this->error = GetLang('apiCouponCodeAlreadyExists');
         return false;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:15,代码来源:coupon.api.php

示例3: create

		/**
		* Create a new item in the database
		*
		* @return mixed false if failed to create, the id of the item otherwise
		*/
		public function create($updateCache = true)
		{
			$_POST['catparentlist'] = '';
			$_POST['catviews'] = 0;
			if (!$this->CategoryExists($_POST['catparentid'], $_POST['catname'])) {
				$CatId = parent::create();

				// If the save was successful
				if($CatId) {
					if ($updateCache) {
						// adjust the nested set data for the new category
						$nested = new ISC_NESTEDSET_CATEGORIES();
						$nested->adjustInsertedNode($CatId, (int)$_POST['catparentid']);

						// If the category doesn't have a parent, rebuild the root categories cache
						if($_POST['catparentid'] == 0) {
							$GLOBALS['ISC_CLASS_DATA_STORE']->UpdateRootCategories();
						}

						// Rebuild the group pricing caches
						$GLOBALS['ISC_CLASS_DATA_STORE']->UpdateCustomerGroupsCategoryDiscounts();
					}

					// Also save our search record
					$this->saveSearch($CatId);

					// Save the words to the category_words table for search spelling suggestions
					Store_SearchSuggestion::manageSuggestedWordDatabase("category", $CatId, $_POST["catname"]);
				}

				return $CatId;
			} else {
				$this->error = sprintf(GetLang('apiCatAlreadyExists'), $_POST['catname']);
				return false;
			}
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:41,代码来源:category.api.php

示例4: create

		public function create()
		{
			return parent::create();
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:4,代码来源:discount.api.php

示例5: create

 /**
  * Send the ticket to FP!
  *
  * @return string Footprints ticket number, or an error.
  */
 public function create()
 {
     return API::create(array($this));
 }
开发者ID:unikent,项目名称:lib-php-footprints,代码行数:9,代码来源:Ticket.php


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