You are here

interface CartManagerInterface in Ubercart 8.4

Defines a common interface for cart managers.

Hierarchy

Expanded class hierarchy of CartManagerInterface

All classes that implement CartManagerInterface

6 files declare their use of CartManagerInterface
CartBlock.php in uc_cart/src/Plugin/Block/CartBlock.php
CartController.php in uc_cart/src/Controller/CartController.php
CartLinksForm.php in uc_cart_links/src/Form/CartLinksForm.php
CheckoutController.php in uc_cart/src/Controller/CheckoutController.php
EmptyCartForm.php in uc_cart/src/Form/EmptyCartForm.php

... See full list

File

uc_cart/src/CartManagerInterface.php, line 10

Namespace

Drupal\uc_cart
View source
interface CartManagerInterface {

  /**
   * Loads a cart object.
   *
   * @param string|null $id
   *   (optional) The ID of the cart to load, or NULL to load the current cart.
   *
   * @return \Drupal\uc_cart\CartInterface
   *   An object representing the cart.
   */
  public function get($id = NULL);

  /**
   * Empties a cart.
   *
   * @param int $id
   *   The ID of the cart to empty.
   */
  public function emptyCart($id);

  /**
   * Completes a sale, including adjusting order status and creating an account.
   *
   * @param \Drupal\uc_order\OrderInterface $order
   *   The order entity that has just been completed.
   * @param bool $login
   *   TRUE if the user should be logged in (where configured), FALSE otherwise.
   *
   * @return array
   *   A render array for the default order completion page.
   */
  public function completeSale(OrderInterface $order, $login = TRUE);

}

Members

Namesort descending Modifiers Type Description Overrides
CartManagerInterface::completeSale public function Completes a sale, including adjusting order status and creating an account. 1
CartManagerInterface::emptyCart public function Empties a cart. 1
CartManagerInterface::get public function Loads a cart object. 1