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;
}