Sunnysideup\Ecommerce\Model\OrderItem
An order item links to a Buyable (product) by class name That is, we only store the BuyableID and the ClassName
Synopsis
class OrderItem
extends OrderAttribute
{
- // members
- protected static array $calculated_buyable_price = ;
- protected array $tempBuyableStore = ;
- protected static array $buyableCached = ;
- private static array $api_access = ;
- private static array $ajax_total_format = ;
- private static string $table_name = 'OrderItem';
- private static array $db = ;
- private static array $indexes = ;
- private static array $casting = ;
- private static array $searchable_fields = ;
- private static array $field_labels = ;
- private static array $summary_fields = ;
- private static string $singular_name = 'Order Item';
- private static string $plural_name = 'Order Items';
- private static string $description = 'Any item that is added to an order and sits before the sub-total. ';
- // Inherited members from OrderAttribute
- protected null|bool $_canEdit;
- protected null|bool $_canView;
- protected bool $baseInitCalled;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public static DataObject get_version()
- public void getCMSFields()
- public bool canDelete()
- public FieldList scaffoldSearchFields()
- public void addBuyableToOrderItem()
- public array updateForAjax()
- public void runUpdate()
- public bool hasSameContent()
- public static void reset_calculated_buyable_price()
- public void UnitPrice()
- public void getUnitPrice()
- public void UnitPriceAsMoney()
- public void getUnitPriceAsMoney()
- public float Total()
- public void getTotal()
- public DBMoney TotalAsMoney()
- public void getTotalAsMoney()
- public void InternalItemID()
- public void getInternalItemID()
- public EcomQuantityField QuantityField()
- public DBCurrency TotalAsCurrencyObject()
- public static void reset_price_has_been_fixed()
- public void getBuyableCached()
- public DataObject Buyable()
- public DataObject getBuyable()
- public string BuyableTitle()
- public string getBuyableTitle()
- public void getTitle()
- public string BuyableLink()
- public string getBuyableLink()
- public void BuyableExists()
- public void getBuyableExists()
- public string BuyableFullName()
- public string getBuyableFullName()
- public string BuyableMoreDetails()
- public string getBuyableMoreDetails()
- public string Link()
- public string getLink()
- public string AbsoluteLink()
- public string getAbsoluteLink()
- public string CheckoutLink()
- public string AddLink()
- public string IncrementLink()
- public string DecrementLink()
- public string RemoveLink()
- public string RemoveAllLink()
- public string RemoveAllAndEditLink()
- public string SetSpecificQuantityItemLink()
- public void debug()
- public void resetCache()
- protected void buyableCacheKey()
- protected void onBeforeWrite()
- protected void onAfterWrite()
- protected array linkParameters()
- // Inherited methods from OrderAttribute
- public void i18n_singular_name()
- public void i18n_plural_name()
- public void init()
- public bool canCreate()
- public bool canView()
- public bool canEdit()
- public bool canDelete()
- public string CMSEditLink()
- public static void set_price_has_been_fixed()
- public static null|bool get_price_has_been_fixed()
- public string OrderAttributeType()
- public null|Order Order()
- public string Classes()
- public EcommerceConfigAjaxDefinitions AJAXDefinitions()
- public void ShowInTable()
- public bool ShowInCart()
- public string TableTitle()
- public void getTableTitle()
- public string CartTitle()
- public void getCartTitle()
- public string TableSubTitle()
- public void getTableSubTitle()
- public string TableSubTitleNOHTML()
- public void getTableSubTitleNOHTML()
- public string CartSubTitle()
- public void getCartSubTitle()
- public DBMoney CalculatedTotalAsMoney()
- public void getCalculatedTotalAsMoney()
- public void runUpdate()
- public void debug()
- protected void onBeforeWrite()
- protected void onAfterWrite()
- protected bool priceHasBeenFixed()
- // Inherited methods from OrderCached
- public void setOrderCached()
- public Order|null; getOrderCached()
Hierarchy
Tasks
Line | Task |
---|---|
1045+ | : do we still need this? |
Members
private
- $ajax_total_format — array
- $api_access
—
array
what variables are accessible through http://mysite.com/api/ecommerce/v1/OrderItem/. - $casting — array
- $db
- $description
—
string
Standard SS variable. - $field_labels — array
- $indexes — array
- $plural_name
—
string
plural name of the object. it is recommended to override this in any extensions of this class. - $searchable_fields — array
- $singular_name
—
string
singular name of the object. it is recommended to override this in any extensions of this class. - $summary_fields — array
- $table_name
—
array
stardard SS variable.
protected
- $_canEdit
—
Sunnysideup\Ecommerce\Model\null|bool
save edit status for speed's sake. - $_canView
—
Sunnysideup\Ecommerce\Model\null|bool
save view status for speed's sake. - $baseInitCalled
—
Sunnysideup\Ecommerce\Model\bool
we use this variable to make sure that the parent::runUpdate() is called in all child classes this is similar to the checks run for parent::init in the controller class. - $buyableCached
- $calculated_buyable_price
- $orderCached — Sunnysideup\Ecommerce\Model\Order
- $orderCachedStatusID — int
- $tempBuyableStore
—
array
Store for buyables.
Methods
protected
- buyableCacheKey()
- linkParameters()
- onAfterWrite() — Standard SS method the method below is very important...
- onBeforeWrite() — Standard SS method.
public
- AbsoluteLink() — alias.
- AddLink()
- Buyable()
- BuyableExists() — Is there a current version of the buyable in the database.
- BuyableFullName()
- BuyableLink()
- BuyableMoreDetails()
- BuyableTitle()
- CheckoutLink()
- DecrementLink()
- IncrementLink()
- InternalItemID() — Casted variable returns InternalItemID from Buyable.
- Link()
- QuantityField()
- RemoveAllAndEditLink()
- RemoveAllLink()
- RemoveLink()
- SetSpecificQuantityItemLink()
- Total()
- TotalAsCurrencyObject()
- TotalAsMoney()
- UnitPrice()
- UnitPriceAsMoney()
- addBuyableToOrderItem()
- canDelete() — standard SS method.
- debug()
- getAbsoluteLink()
- getBuyable()
- getBuyableCached()
- getBuyableExists() — Is there a current version of the buyable in the database.
- getBuyableFullName()
- getBuyableLink()
- getBuyableMoreDetails()
- getBuyableTitle()
- getCMSFields() — Standard SS method.
- getInternalItemID()
- getLink()
- getTitle()
- getTotal()
- getTotalAsMoney()
- getUnitPrice()
- getUnitPriceAsMoney()
- get_version() — HACK: Versioned is BROKEN this method helps in fixing it.
- hasSameContent() — Check if two Order Items are the same.
- i18n_plural_name()
- i18n_singular_name()
- resetCache()
- reset_calculated_buyable_price()
- reset_price_has_been_fixed()
- runUpdate() — saves details about the Order Item before the order is submittted.
- scaffoldSearchFields() — Determine which properties on the DataObject are searchable, and map them to their default {@link FormField} representations. Used for scaffolding a searchform for {@link ModelAdmin}.
- updateForAjax() — used to return data for ajax.
Inherited from Sunnysideup\Ecommerce\Model\OrderAttribute
protected
- onAfterWrite() — Standard SS method.
- onBeforeWrite() — Standard SS method We add the Sort value from the OrderAttributeGroup to the OrderAttribute.
- priceHasBeenFixed() — meaning that is has been saved in the CalculatedTotal field so that it can not be altered.
public
- AJAXDefinitions() — returns the instance of EcommerceConfigAjax for use in templates.
- CMSEditLink() — link to edit the record.
- CalculatedTotalAsMoney() — Returns the Money object of the CalculatedTotal.
- CartSubTitle() — the sub title for the order item or order modifier.
- CartTitle() — Return a name of what this attribute is called e.g. "Product 21" or "Discount" Cart is a short version of table.
- Classes() — Return a string of class names, in order of hierarchy from OrderAttribute for the current attribute.
- Order() — returns the order - for some unknown reason it seems we need this.
- OrderAttributeType() — This is a key function that returns the type of the object. In principle anything can be returned but the intention is to only return a few options e.g. OrderItem, Tax, Delivery, etc... so that computations can be carried out based on the type of OrderAttribute we are looking at.
- ShowInCart() — Should this item be shown on in the cart (which is on other pages than the checkout page).
- ShowInTable()
- TableSubTitle() — the sub title for the order item or order modifier.
- TableSubTitleNOHTML() — the sub title for the order item or order modifier.
- TableTitle() — Return a name of what this attribute is called e.g. "Product 21" or "Discount".
- canCreate() — standard SS method.
- canDelete() — Standard SS method.
- canEdit() — Standard SS method This is an important method.
- canView() — Standard SS method This is an important method.
- debug() — Debug helper method.
- getCalculatedTotalAsMoney()
- getCartSubTitle()
- getCartTitle()
- getTableSubTitle()
- getTableSubTitleNOHTML()
- getTableTitle()
- get_price_has_been_fixed()
- i18n_plural_name()
- i18n_singular_name()
- init() — extended in OrderModifier and OrderItem Starts up the order Atribute TODO: introduce system like we have for Controller which makes sure that all parent init methods are called.
- runUpdate()
- set_price_has_been_fixed()