SilverCart\Model\Order\OrderPosition
The OrderPosition object.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class OrderPosition
extends DataObject
{
- // members
- public boolean $log = true;
- protected boolean $doRecalculate = false;
- public boolean $objectCreated = false;
- public boolean $objectDeleted = false;
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static string $table_name = 'SilvercartOrderPosition';
- private static bool $api_access = true;
- // methods
- public array fieldLabels()
- public string singular_name()
- public string plural_name()
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- public array exportColumns()
- public array summaryFields()
- public array searchableFields()
- public DBHTMLText AfterPriceNiceContent()
- public DBHTMLText BeforePriceNiceContent()
- public DBHTMLText getPriceNice()
- public DBHTMLText AfterPriceTotalNiceContent()
- public DBHTMLText BeforePriceTotalNiceContent()
- public DBHTMLText getPriceTotalNice()
- public DBMoney getTaxMoney()
- public DBMoney getTaxTotalMoney()
- public mixed getTypeSafeQuantity()
- public DBHTMLText getFullTitle()
- public string getTitleNoHTML()
- public DBText getShortDescription()
- public string getCreatedNice()
- public string getProductNumber()
- public bool MoreThanOneProduct()
- public FieldList getCMSFields()
- public void onBeforeWrite()
- public void saveChanges()
- public void saveNew()
- public void onAfterWrite()
- public void onAfterDelete()
- public void onBeforeDelete()
- public DBHTMLText addToTitle()
- public DBHTMLText forTemplate()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $api_access
—
SilverCart\Model\Order\bool
Grant API access on this item. - $casting
—
array
casted attributes - $db
—
array
attributes - $has_one
—
array
1:n relations - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels. - $doRecalculate
—
boolean
Indicates whether the order should be recalculated in method "onAfterWrite".
public
- $log
—
boolean
Indicates whether changes and creations of order positions should be logged or not. - $objectCreated
—
boolean
Indicates whether the position has been created. Used in onBeforeWrite. - $objectDeleted
—
boolean
Indicates whether the position has been deleted. Used in onBeforeDelete.
Methods
public
- AfterPriceNiceContent() — Returns some additional content to insert right after the nice price is rendered.
- AfterPriceTotalNiceContent() — Returns some additional content to insert right after the nice price is rendered.
- BeforePriceNiceContent() — Returns some additional content to insert right before the nice price is rendered.
- BeforePriceTotalNiceContent() — Returns some additional content to insert right before the nice price is rendered.
- MoreThanOneProduct() — Returns true if this position has a quantity of more than 1.
- addToTitle() — Returns additional tile information provided by plugins
- canDelete() — Indicates wether the current user can delete this object.
- canEdit() — Indicates wether the current user can edit this object.
- canView() — Indicates wether the current user can view this object.
- exportColumns() — Returns the CSV export columns.
- fieldLabels() — Field labels for display in tables.
- forTemplate() — Returns the rendered position.
- getCMSFields() — Customize scaffolding fields for the backend
- getCreatedNice() — returns the orders creation date formated: dd.mm.yyyy hh:mm
- getFullTitle() — returns the order positions Title with extensions
- getPriceNice() — returns the orders total amount as string incl. currency.
- getPriceTotalNice() — returns the orders total amount as string incl. currency.
- getProductNumber() — Returns the product number as a string.
- getShortDescription() — returns the order positions Title with extensions
- getTaxMoney() — Returns the tax value as a money object.
- getTaxTotalMoney() — Returns the tax total value as a money object.
- getTitleNoHTML() — returns the order positions Title without HTML.
- getTypeSafeQuantity() — Returns the quantity according to the Product quantity type setting.
- onAfterDelete() — Make onAfterDelete extendable.
- onAfterWrite() — Recalculate the order if necessary.
- onBeforeDelete() — Make onBeforeDelete extendable.
- onBeforeWrite() — If the attributed product gets changed we adjust all order position fields accordingly.
- plural_name() — Returns the translated plural name of the object. If no translation exists the class name will be returned.
- saveChanges() — Saves changes on an existing position.
- saveNew() — Saves changes for a new position.
- searchableFields() — Searchable fields.
- singular_name() — Returns the translated singular name of the object. If no translation exists the class name will be returned.
- summaryFields() — Summaryfields for display in tables.
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.