當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WishList::delete方法代碼示例

本文整理匯總了PHP中WishList::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP WishList::delete方法的具體用法?PHP WishList::delete怎麽用?PHP WishList::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WishList的用法示例。


在下文中一共展示了WishList::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete_list

 /**
  * @param SS_HTTPRequest $req
  * @return bool|SS_HTTPResponse
  */
 public function delete_list(SS_HTTPRequest $req)
 {
     if (!SecurityToken::inst()->checkRequest($req)) {
         $this->httpError(403);
     }
     $this->wishList->removeAllBuyables();
     $this->wishList->delete();
     WishList::set_current(null);
     $this->wishList = WishList::current();
     $this->extend('updateDeleteListResponse', $req, $response);
     return $response ? $response : $this->redirectBack();
 }
開發者ID:markguinn,項目名稱:silverstripe-wishlist,代碼行數:16,代碼來源:WishListPage.php

示例2: dirname

            $errors[] = Tools::displayError('invalid token');
        }
        if (!sizeof($errors)) {
            $name = Tools::getValue('name');
            $wishlist = new WishList();
            $wishlist->name = $name;
            $wishlist->id_customer = $cookie->id_customer;
            list($us, $s) = explode(' ', microtime());
            srand($s * $us);
            $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true) . _COOKIE_KEY_ . $cookie->id_customer), 0, 16));
            $wishlist->add();
        }
    } else {
        if ($add) {
            WishList::addCardToWishlist(intval($cookie->id_customer), intval(Tools::getValue('id_wishlist')), intval($cookie->id_lang));
        } else {
            if ($delete and empty($id_wishlist) === false) {
                $wishlist = new WishList(intval($id_wishlist));
                $wishlist->delete();
            }
        }
    }
    $smarty->assign('wishlists', WishList::getByIdCustomer(intval($cookie->id_customer)));
    $smarty->assign('nbProducts', WishList::getInfosByIdCustomer(intval($cookie->id_customer)));
} else {
    $errors[] = Tools::displayError('You need to be logged to manage your wishlist');
}
$smarty->assign('id_customer', intval($cookie->id_customer));
$smarty->assign('errors', $errors);
$smarty->display(dirname(__FILE__) . '/mywishlist.tpl');
include dirname(__FILE__) . '/../../footer.php';
開發者ID:sealence,項目名稱:local,代碼行數:31,代碼來源:mywishlist.php


注:本文中的WishList::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。