本文整理汇总了PHP中DiscountAbsolute::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscountAbsolute::delete方法的具体用法?PHP DiscountAbsolute::delete怎么用?PHP DiscountAbsolute::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiscountAbsolute
的用法示例。
在下文中一共展示了DiscountAbsolute::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DiscountAbsolute
} else {
$error++;
$mesg = '<div class="error">' . $soc->error . '</div>';
}
}
} else {
$mesg = '<div class="error">' . $langs->trans("ErrorFieldFormat", $langs->trans("NewGlobalDiscount")) . '</div>';
}
}
if (GETPOST("action") == 'confirm_remove' && GETPOST("confirm") == 'yes') {
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)
$db->begin();
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(GETPOST("remid"));
$result = $discount->delete($user);
if ($result > 0) {
$db->commit();
header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . GETPOST('id', 'int'));
// To avoid pb whith back
exit;
} else {
$mesg = '<div class="error">' . $discount->error . '</div>';
$db->rollback();
}
}
/*
* View
*/
$form = new Form($db);
$facturestatic = new Facture($db);
示例2: testDiscountDelete
/**
* testDiscountDelete
*
* @param int $id Id of discount
* @return int
*
* @depends testDiscountFetch
* The depends says test is run only if previous is ok
*/
public function testDiscountDelete($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new DiscountAbsolute($this->savdb);
$result=$localobject->fetch($id);
$result=$localobject->delete($user);
print __METHOD__." id=".$id." result=".$result."\n";
$this->assertLessThan($result, 0);
return $result;
}