本文整理汇总了PHP中Currency::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::delete方法的具体用法?PHP Currency::delete怎么用?PHP Currency::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Currency
的用法示例。
在下文中一共展示了Currency::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteSelection
public function deleteSelection($selection)
{
if (!is_array($selection) or !Validate::isTableOrIdentifier($this->identifier) or !Validate::isTableOrIdentifier($this->table)) {
die(Tools::displayError());
}
foreach ($selection as $id) {
$obj = new Currency((int) $id);
$res[$id] = $obj->delete();
}
foreach ($res as $value) {
if (!$value) {
return false;
}
}
return true;
}
示例2: delete
/**
* Delete existing currency
*
* @param void
* @return null
*/
function delete()
{
if ($this->active_currency->isNew()) {
$this->httpError(HTTP_ERR_NOT_FOUND);
}
// if
if ($this->request->isSubmitted()) {
$delete = $this->active_currency->delete();
if ($delete && !is_error($delete)) {
flash_success('Currency ":name" has been deleted', array('name' => $this->active_currency->getName()));
} else {
flash_error('Failed to delete ":name" currency', array('name' => $this->active_currency->getName()));
}
// if
$this->redirectTo('admin_currencies');
} else {
$this->httpError(HTTP_ERR_BAD_REQUEST);
}
// if
}
示例3: storeCurrencies
/**
* Stores the Currencies as present in the POST request
*
* See {@see Currency::delete()},
* {@see Currency::add()}, and
* {@see Currency::update()}.
*/
static function storeCurrencies()
{
//DBG::log("start of storeCurrencies: ".self::$success.", changed: ".self::$changed);
$result = Currency::delete();
if (isset($result)) {
self::$changed = true;
self::$success &= $result;
}
//DBG::log("after delete: ".self::$success.", changed: ".self::$changed);
$result = Currency::add();
if (isset($result)) {
self::$changed = true;
self::$success &= $result;
}
//DBG::log("after add: ".self::$success.", changed: ".self::$changed);
$result = Currency::update();
if (isset($result)) {
self::$changed = true;
self::$success &= $result;
}
//DBG::log("after update: ".self::$success.", changed: ".self::$changed);
if (self::$changed) {
// Remember to reinit the Currencies, or the User
// won't see changes instantly
Currency::reset();
}
}
示例4: deleteSelection
public function deleteSelection($selection)
{
if (!is_array($selection)) {
die(Tools::displayError());
}
foreach ($selection as $id) {
$obj = new Currency((int) $id);
$res[$id] = $obj->delete();
}
foreach ($res as $value) {
if (!$value) {
return false;
}
}
return true;
}
示例5: deleteSelection
public function deleteSelection($selection)
{
if (!is_array($selection)) {
return false;
}
$res = array();
foreach ($selection as $id) {
$obj = new Currency((int) $id);
$res[$id] = $obj->delete();
}
foreach ($res as $value) {
if (!$value) {
return false;
}
}
return true;
}