public function __construct($data = null, $options = null) { parent::__construct($data, $options); $cart = \Zrecommerce\Storefront\Session::getNs('cart', array()); if (!empty($cart)) { self::$_cart = $cart; } //$this->restURL( APP_URL . '/api/cart' ); }
public function __construct($data = null, $options = null) { parent::__construct($data, $options); $this->restURL(API_URL . '/item'); }
static function signOff() { $session = new Model\Rest(null, array('restURL' => API_URL . '/session')); $token = session_id(); $ip = $_SERVER['REMOTE_ADDR']; $session->option('query', array('token' => $token, 'ip' => $ip)); $session->option('sort', array('timestamp_added' => -1, 'timestamp_modified' => -1, 'timestamp_deactivated' => -1)); $sessions = $session->Get(); // Remove all of this user's sessions. if (count($sessions->data) > 0) { foreach ($sessions->data as $sess) { $s = new Model\Rest($sess, array('restURL' => API_URL . '/session')); $s->Delete(); } } // New session required after this. Remember to redirect. session_regenerate_id(); }