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/slenders.komma.pro/app/Komma/Shop/Discounts/DiscountableInterface.php
<?php
namespace App\Komma\Shop\Discounts;

/**
 * Interface Discountable
 *
 * Represents something that can have a discount applied to
 *
 * @package App\Komma\Shop\Discounts
 */
interface DiscountableInterface
{
    /**
     * Applies the discount to itself
     *
     * @param Discount $discount
     * @return DiscountableInterface
     */
    public function applyDiscount(Discount $discount):DiscountableInterface;

    /**
     * Returns all discounts applied
     *
     * @return Discount[]
     */
    public function getDiscounts():array;

    /**
     * Returns the amount of items
     *
     * @param bool $unique If the discountable has multiple Items and this is set to true, it will only return count the unique ones
     * @param bool $includeDiscounts Whether or not to add the amount of discounts to the total count.
     * @return int
     */
    public function getItemsCount(bool $unique = false, bool $includeDiscounts = false):int;

    /**
     * Get price total with or without discounts applied. This value is in cents
     *
     * @param bool $includeDiscounts
     * @return mixed
     */
    public function getTotal(bool $includeDiscounts = true): float;

    /**
     * Removes all discounts
     */
    public function clearDiscounts(): void;

    /**
     * Returns all discounts applied, from a certain type
     *
     * @param null $type
     * @return Discount[]
     */
    public function getDiscountsByType($type = null): array;
}