Heystack\Ecommerce\Purchasable\Interfaces\PurchasableHolderInterface
PurchasableHolderInterface
This defines what methods are necessary to implement a Purchasable Holder Class
- Author: Stevie Mayhew <stevie@heyday.co.nz>
- Copyright: Heyday
Synopsis
interface PurchasableHolderInterface
extends TransactionModifierInterface, ParentReferenceInterface, StateableInterface, Serializable, StorableInterface
{
- // methods
- public array getPurchasables()
- public void setPurchasables()
- public void addPurchasable()
- public void setPurchasable()
- public PurchasableInterface getPurchasable()
- public array getPurchasablesByPrimaryIdentifier()
- public void removePurchasable()
- public void removePurchasables()
- public void updatePurchasablePrices()
- public void updateTotal()
- // Inherited methods from TransactionModifierInterface
- public Identifier getIdentifier()
- public Money getTotal()
- public string getType()
- // Inherited methods from Serializable
- public string serialize()
- public void unserialize()
Hierarchy
Extends
- Heystack\Ecommerce\Transaction\Interfaces\TransactionModifierInterface
- Heystack\Core\Storage\Interfaces\ParentReferenceInterface
- Heystack\Core\State\StateableInterface
- Serializable
- Heystack\Core\Storage\StorableInterface
Methods
public
- addPurchasable() — Add a purchasable to the implementing class
- getPurchasable() — Retrieves a purchasable from the implementing class' internal cache of purchasables
- getPurchasables() — Returns an array of all the purchasables held by the implementing class
- getPurchasablesByPrimaryIdentifier() — Retrieves purchasables from the implementing class' internal cache of purchasables using the Primary string on the Identifier object
- removePurchasable() — Removes a purchasable from the implementing class' internal cache of purchasables
- removePurchasables() — Removes all purchasables from the service
- setPurchasable() — Sets the quantity of the purchasable in the implementing class
- setPurchasables() — Sets the purchasables array to be held by the implementing class
- updatePurchasablePrices() — Updates the prices of the currently held purchasables
- updateTotal() — Updates the total based on all purchasables held
Inherited from Heystack\Ecommerce\Transaction\Interfaces\TransactionModifierInterface
public
- getIdentifier() — Returns a unique identifier for use in the Transaction
- getTotal() — Returns the total value of the TransactionModifier for use in the Transaction
- getType() — Indicates the type of amount the modifier will return Must return a constant from TransactionModifierTypes
Inherited from Serializable
public
- serialize() — String representation of object
- unserialize() — Constructs the object