HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Cart/ShoppingCartInterface.php
<?php declare(strict_types=1);

namespace App\Cart;


use App\Discounts\DiscountableInterface;
use App\Products\AbstractProductable;

/**
 * Represents a shopping cart
 *
 * Class ShoppingCartService
 *
 * @package App\Cart
 */
interface ShoppingCartInterface extends DiscountableInterface
{
    /**
     * Add a productable in the cart
     *
     * @param AbstractProductable $productable
     * @param int                 $quantity
     *
     * @return ShoppingCartItem
     */
    public function addProductable(AbstractProductable $productable, int $quantity = 1): ?ShoppingCartItem;

    /**
     * Set the amount of items for a product
     *
     * @param int $itemId
     * @param int $quantity
     *
     * @return $this
     */
    public function setItemQuantity(int $itemId, int $quantity = 1): ShoppingCartInterface;

    /**
     * Deletes the ShoppingCartItem that has a product with the specified id
     *
     * @param int $itemId
     *
     * @return ShoppingCartInterface
     */
    public function deleteItem(int $itemId): ShoppingCartInterface;

    /**
     * Clears the shopping cart of all items
     *
     * @return ShoppingCartInterface
     */
    public function clear(): ShoppingCartInterface;

    /**
     * Returns the amount of items in the cart.
     *
     * @return int
     */
    public function getItemsCount(): int;

    /**
     * Get all shopping cart items
     *
     * @return array
     */
    public function getItems(): array;
}