SilverShop\Model\OrderItem
An order item is a product which has been added to an order, ready for purchase. An order item is typically a product itself, but also can include references to other information such as product attributes like colour, size, or type.
Synopsis
class OrderItem
extends OrderAttribute
{
- // members
- private static array $db = ;
- private static array $casting = ;
- private static array $searchable_fields = ;
- private static array $summary_fields = ;
- private static array $required_fields = ;
- private static string $buyable_relationship = 'Product';
- private static string $singular_name = 'Item';
- private static string $plural_name = 'Items';
- private static string $default_sort = '"Created" DESC';
- private static string $table_name = 'SilverShop_OrderItem';
- // methods
- public void Buyable()
- public void UnitPrice()
- public void setUnitPrice()
- public void setQuantity()
- public void Total()
- protected void calculatetotal()
- public void uniquedata()
- public void onBeforeWrite()
- public void onPayment()
- public void onPlacement()
- public void Image()
- public ShopQuantityField QuantityField()
- public string addLink()
- public string removeLink()
- public string removeallLink()
- public string setquantityLink()
- // Inherited methods from OrderAttribute
- public void canCreate()
- public void canDelete()
- public void isLive()
- public string getTableTitle()
- public void getCartTitle()
- public void ShowInTable()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
146 | also combine with all ancestors of this->class |
Members
private
- $buyable_relationship
—
string
The ORM relationship to the buyable item - $casting
- $db
- $default_sort
- $plural_name
- $required_fields
- $searchable_fields
- $singular_name
- $summary_fields
- $table_name
Methods
protected
- calculatetotal() — Calculates the total for this item.
public
- Buyable() — Get the buyable object related to this item.
- Image() — Get the buyable image.
- QuantityField()
- Total() — Get calculated total, or stored total depending on whether the order is in cart
- UnitPrice() — Get unit price for this item.
- addLink()
- onBeforeWrite() — Recalculate total before saving to database.
- onPayment()
- onPlacement() — Event handlier called for last time saving/processing, before item permanently stored in database.
- removeLink()
- removeallLink()
- setQuantity() — Prevent quantity being below 1.
- setUnitPrice() — Prevent unit price ever being below 0
- setquantityLink()
- uniquedata() — Intersects this item's required_fields with the data record.
Inherited from SilverShop\Model\OrderAttribute
public
- ShowInTable()
- canCreate()
- canDelete()
- getCartTitle()
- getTableTitle() — Produces a title for use in templates.
- isLive()