You are here

interface CartInterface in Basic cart 8.6

Same name and namespace in other branches
  1. 8 src/CartInterface.php \Drupal\basic_cart\CartInterface
  2. 8.0 src/CartInterface.php \Drupal\basic_cart\CartInterface
  3. 8.2 src/CartInterface.php \Drupal\basic_cart\CartInterface
  4. 8.3 src/CartInterface.php \Drupal\basic_cart\CartInterface
  5. 8.4 src/CartInterface.php \Drupal\basic_cart\CartInterface
  6. 8.5 src/CartInterface.php \Drupal\basic_cart\CartInterface

Cart interface definition for basic_cart plugins.

Hierarchy

Expanded class hierarchy of CartInterface

All classes that implement CartInterface

File

src/CartInterface.php, line 8

Namespace

Drupal\basic_cart
View source
interface CartInterface {

  /**
   * Get Cart.
   *
   * @param int $nid
   *   Node id.
   */
  public function getCart($nid = NULL);

  /**
   * Remove from Cart.
   *
   * @param int $nid
   *   Node id.
   */
  public function removeFromCart($nid);

  /**
   * Empty cart.
   */
  public function emptyCart();

  /**
   * Add to cart.
   *
   * @param int $id
   *   Node id.
   * @param array $params
   *   Array to define quantity and entity type.
   */
  public function addToCart($id, array $params = array());

}

Members

Namesort descending Modifiers Type Description Overrides
CartInterface::addToCart public function Add to cart. 2
CartInterface::emptyCart public function Empty cart. 2
CartInterface::getCart public function Get Cart. 2
CartInterface::removeFromCart public function Remove from Cart. 2