本文整理汇总了PHP中Discount::deleteByIdCustomer方法的典型用法代码示例。如果您正苦于以下问题:PHP Discount::deleteByIdCustomer方法的具体用法?PHP Discount::deleteByIdCustomer怎么用?PHP Discount::deleteByIdCustomer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Discount
的用法示例。
在下文中一共展示了Discount::deleteByIdCustomer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$addresses = $this->getAddresses((int) Configuration::get('PS_LANG_DEFAULT'));
foreach ($addresses as $address) {
$obj = new Address((int) $address['id_address']);
$obj->delete();
}
Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'customer_group` WHERE `id_customer` = ' . (int) $this->id);
Discount::deleteByIdCustomer((int) $this->id);
return parent::delete();
}
示例2: postProcess
//.........这里部分代码省略.........
} else {
if ($this->tabAccess['add'] === '1') {
$object = new $this->className();
$this->copyFromPost($object, $this->table);
if (!$object->add()) {
$this->_errors[] = Tools::displayError('An error occurred while creating object.') . ' <b>' . $this->table . ' (' . mysql_error() . ')</b>';
} elseif ($_POST[$this->identifier] = $object->id and $this->postImage($object->id) and !sizeof($this->_errors) and $this->_redirect) {
// Add Associated groups
$group_list = Tools::getValue('groupBox');
if (is_array($group_list) && sizeof($group_list) > 0) {
$object->addGroups($group_list, true);
}
$parent_id = (int) Tools::getValue('id_parent', 1);
// Save and stay on same form
if (Tools::isSubmit('submitAdd' . $this->table . 'AndStay')) {
Tools::redirectAdmin($currentIndex . '&' . $this->identifier . '=' . $object->id . '&conf=3&update' . $this->table . '&token=' . $this->token);
}
// Save and back to parent
if (Tools::isSubmit('submitAdd' . $this->table . 'AndBackToParent')) {
Tools::redirectAdmin($currentIndex . '&' . $this->identifier . '=' . $parent_id . '&conf=3&token=' . $this->token);
}
// Default behavior (save and back)
Tools::redirectAdmin($currentIndex . ($parent_id ? '&' . $this->identifier . '=' . $object->id : '') . '&conf=3&token=' . $this->token);
}
} else {
$this->_errors[] = Tools::displayError('You do not have permission to add here.');
}
}
}
} elseif (Tools::isSubmit('delete' . $this->table) and $this->tabAccess['delete'] === '1') {
switch (Tools::getValue('deleteMode')) {
case 'real':
$this->deleted = false;
Discount::deleteByIdCustomer((int) Tools::getValue('id_customer'));
break;
case 'deleted':
$this->deleted = true;
break;
default:
echo $deleteForm;
if (isset($_POST['delete' . $this->table])) {
unset($_POST['delete' . $this->table]);
}
if (isset($_GET['delete' . $this->table])) {
unset($_GET['delete' . $this->table]);
}
break;
}
} elseif (Tools::isSubmit('submitDel' . $this->table) and $this->tabAccess['delete'] === '1') {
switch (Tools::getValue('deleteMode')) {
case 'real':
$this->deleted = false;
foreach (Tools::getValue('customerBox') as $id_customer) {
Discount::deleteByIdCustomer((int) $id_customer);
}
break;
case 'deleted':
$this->deleted = true;
break;
default:
echo $deleteForm;
if (isset($_POST['submitDel' . $this->table])) {
unset($_POST['submitDel' . $this->table]);
}
if (isset($_GET['submitDel' . $this->table])) {
unset($_GET['submitDel' . $this->table]);
示例3: processDelete
public function processDelete()
{
if ($this->delete_mode == 'real') {
$this->deleted = false;
Discount::deleteByIdCustomer((int) Tools::getValue('id_customer'));
} elseif ($this->delete_mode == 'deleted') {
$this->deleted = true;
} else {
$this->errors[] = Tools::displayError('Unknown delete mode:') . ' ' . $this->deleted;
return;
}
parent::processDelete();
}