SilverCart\Model\Order\OrderStatus
abstract for an order status.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class OrderStatus
extends DataObject
{
- // constants
- const STATUS_CODE_NEW = 'new';
- const STATUS_CODE_CANCELED = 'canceled';
- const STATUS_CODE_COMPLETED = 'completed';
- const STATUS_CODE_INPROGRESS = 'inprogress';
- const STATUS_CODE_SHIPPED = 'shipped';
- const STATUS_CODE_PREPARING_SHIPMENT = 'preparing-shipment';
- // members
- private static array $db = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static string $default_sort = "SilvercartOrderStatusTranslation.Title";
- private static string $table_name = 'SilvercartOrderStatus';
- private static bool $api_access = true;
- private static array $extensions = ;
- private static array $default_codes = ;
- // methods
- public static OrderStatus get_default()
- public static OrderStatus|null get_by_code()
- public string singular_name()
- public string plural_name()
- public string getTitle()
- public array fieldLabels()
- public array excludeFromScaffolding()
- public FieldList getCMSFields()
- protected void onBeforeWrite()
- public void sendMailFor()
- public static DataList getStatusList()
- public void requireDefaultRecords()
- public array summaryFields()
- public array searchableFields()
- public string getIsDefaultString()
- // 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
Constants
Name | Value |
---|---|
STATUS_CODE_NEW | 'new' |
STATUS_CODE_CANCELED | 'canceled' |
STATUS_CODE_COMPLETED | 'completed' |
STATUS_CODE_INPROGRESS | 'inprogress' |
STATUS_CODE_SHIPPED | 'shipped' |
STATUS_CODE_PREPARING_SHIPMENT | 'preparing-shipment' |
Members
private
- $api_access
—
SilverCart\Model\Order\bool
Grant API access on this item. - $belongs_many_many
—
array
n:m relations - $casting
—
array
Castings - $db
—
array
attributes - $default_codes
—
array
Default status codes - $default_sort
—
string
Default sort - $extensions
—
array
List of extensions to use. - $has_many
—
array
1:n relations - $many_many
—
array
n:m relations - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels.
Methods
protected
- onBeforeWrite() — HAndles a default status change on before write.
public
- excludeFromScaffolding() — Returns an array of field/relation names (db, has_one, has_many, many_many, belongs_many_many) to exclude from form scaffolding in backend.
- fieldLabels() — Returns the field labels.
- getCMSFields() — remove attribute Code from the CMS fields
- getIsDefaultString() — Casting to get the IsDefault state as a readable string
- getStatusList() — returns array with StatusCode => StatusText
- getTitle() — retirieves title from related language class depending on the set locale Title is a very common attribute and is therefore located in the decorator
- get_by_code() — Returns the order status with the given $code.
- get_default() — Returns the default OrderStatus.
- plural_name() — Returns the translated plural name of the object. If no translation exists the class name will be returned.
- requireDefaultRecords() — Adds the default payment status.
- searchableFields() — Searchable fields.
- sendMailFor() — Sends a mail with the given Order object as data provider.
- 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.