本文整理匯總了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;
}