You are here

public function CartManager::get in Ubercart 8.4

Loads a cart object.

Parameters

string|null $id: (optional) The ID of the cart to load, or NULL to load the current cart.

Return value

\Drupal\uc_cart\CartInterface An object representing the cart.

Overrides CartManagerInterface::get

File

uc_cart/src/CartManager.php, line 46

Class

CartManager
Provides the cart manager service.

Namespace

Drupal\uc_cart

Code

public function get($id = NULL) {
  $id = $id ?: $this
    ->getId();
  return new Cart($id);
}