本文整理汇总了PHP中Price::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Price::update方法的具体用法?PHP Price::update怎么用?PHP Price::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Price
的用法示例。
在下文中一共展示了Price::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Product
require_once "DataBase/Price.php";
$db_action = var_get_post("db_action", "");
$product = new Product();
$tax = new Tax();
$category = new Category();
$priceset = new Priceset();
$price = new Price();
$group = new Group();
switch ($db_action) {
case "new":
$product->create(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
$priceset_list = $priceset->get();
for ($i = 0; $i < count($priceset_list); $i++) {
$price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
}
break;
case "edit":
$product->update(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
$priceset_list = $priceset->get();
for ($i = 0; $i < count($priceset_list); $i++) {
if ($price->exists(var_post("priceset_id_" . $i, ""), var_post("product_id", ""))) {
$price->update(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
} else {
$price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
}
}
break;
case "delete":
$product->delete(var_get("product_id", ""));
break;
}
示例2: updatePrice
public function updatePrice($type, $price)
{
Price::update($type, $price);
}