Sunnysideup\Ecommerce\Model\OrderAttribute
Synopsis
class OrderAttribute
extends DataObject
implements
EditableEcommerceObject
{
- // members
- protected null|bool $_canEdit;
- protected null|bool $_canView;
- protected bool $baseInitCalled = false;
- private static array $api_access = ;
- private static string $table_name = 'OrderAttribute';
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static array $default_sort = ;
- private static array $indexes = ;
- private static string $singular_name = 'Order Entry';
- private static string $plural_name = 'Order Extra Descriptions';
- private static string $description = 'Any item that is added to the order - be it before (e.g. product) or after the subtotal (e.g. tax).';
- private static array $_price_has_been_fixed = ;
- // methods
- 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
Extends
- SilverStripe\ORM\DataObject
Uses
Implements
Members
private
- $_price_has_been_fixed
—
array
Helps in speeding up code. - $api_access
—
array
what variables are accessible through http://mysite.com/api/ecommerce/v1/ShippingAddress/. - $casting
—
array
Standard SS variable. - $db
- $default_sort
—
array
Standard SS variable. - $description
—
string
Standard SS variable. - $has_one
—
array
Standard SS variable. - $indexes
—
array
Standard SS variable. - $plural_name
—
string
Standard SS variable. - $singular_name
—
string
Standard SS variable. - $table_name
—
string
Standard 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. - $orderCached — Sunnysideup\Ecommerce\Model\Order
- $orderCachedStatusID — int
Methods
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()