本文整理汇总了PHP中customer::current方法的典型用法代码示例。如果您正苦于以下问题:PHP customer::current方法的具体用法?PHP customer::current怎么用?PHP customer::current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类customer
的用法示例。
在下文中一共展示了customer::current方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Require administrator login
* @Developer brandon
* @Date Oct 11, 2010
*/
public function __construct()
{
parent::__construct();
$this->template = View::factory('layouts/admin');
meta::set_title(store::name() . ' | Admin | ' . ucwords(Router::$controller));
// Set the route for updating and creating files
Kohana::config_set('routes.base_crud_route', 'admin/');
// Require an admin login if we are in production.
if (IN_PRODUCTION) {
customer::require_admin_login();
}
ORM::factory('audit_trail')->create(array('user_id' => customer::current(), 'store_id' => store::get(), 'controller' => Router::$controller, 'method' => Router::$method, 'object_id' => $this->input->post('id')));
}
示例2: get
/**
* Get the cart
* @Developer brandon
* @Date Oct 20, 2010
*/
public static function get()
{
if (customer::logged_in()) {
return customer::current()->load_cart();
} else {
if (Session::instance()->get('cart_' . store::get())) {
return ORM::factory('cart', Session::instance()->get('cart_' . store::get()));
} else {
$cart = ORM::factory('cart');
$cart->save();
Session::instance()->set('cart_' . store::get(), (string) $cart);
return $cart;
}
}
}