You are here

public function CartTokenSession::getCartIds in Commerce Cart API 8

Gets all cart order ids from the session.

Parameters

string $type: The cart session type.

Return value

int[] A list of cart orders ids.

Overrides CartSessionInterface::getCartIds

File

src/CartTokenSession.php, line 58

Class

CartTokenSession
Decorates the cart session to support cart tokens.

Namespace

Drupal\commerce_cart_api

Code

public function getCartIds($type = self::ACTIVE) {
  if ($this
    ->getCurrentRequestCartToken() === NULL) {
    return $this->inner
      ->getCartIds($type);
  }
  $data = $this
    ->getTokenCartData();
  return $data[$type];
}