You are here

private function CartTokenSession::getTokenCartData in Commerce Cart API 8

Get the token cart data.

Return value

array The data.

4 calls to CartTokenSession::getTokenCartData()
CartTokenSession::addCartId in src/CartTokenSession.php
Adds the given cart order ID to the session.
CartTokenSession::deleteCartId in src/CartTokenSession.php
Deletes the given cart order id from the session.
CartTokenSession::getCartIds in src/CartTokenSession.php
Gets all cart order ids from the session.
CartTokenSession::hasCartId in src/CartTokenSession.php
Checks whether the given cart order ID exists in the session.

File

src/CartTokenSession.php, line 126

Class

CartTokenSession
Decorates the cart session to support cart tokens.

Namespace

Drupal\commerce_cart_api

Code

private function getTokenCartData() {
  $defaults = [
    static::ACTIVE => [],
    static::COMPLETED => [],
  ];
  $token = $this
    ->getCurrentRequestCartToken();
  if (empty($token)) {
    return $defaults;
  }
  return $this->tempStore
    ->get($token) ?: $defaults;
}