本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例4: create
public function create()
{
return parent::create();
}
示例5: create
/**
* Send the ticket to FP!
*
* @return string Footprints ticket number, or an error.
*/
public function create()
{
return API::create(array($this));
}