当前位置: 首页>>代码示例>>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;未经允许,请勿转载。