SilverCart\Model\Product\Tax
Defines Taxrates.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class Tax
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_many = ;
- private static array $searchable_fields = ;
- private static array $casting = ;
- private static string $table_name = 'SilvercartTax';
- protected $i18nTitle = NULL;
- // methods
- public array fieldLabels()
- public array summaryFields()
- public string singular_name()
- public string plural_name()
- public FieldList getCMSFields()
- protected void onBeforeWrite()
- public string getTitle()
- public void setTitle()
- public void setI18nTitle()
- public string getIsDefaultString()
- public float getTaxRate()
- public static Tax|null getDefault()
- public static void presetDropdownWithDefault()
- // 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
- $casting
—
array
cast fields to other SS data types - $db
—
array
attributes - $has_many
—
array
n:m relations - $searchable_fields
—
array
List of searchable fields for the model admin - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels. - $i18nTitle
—
string
The i18n dependent title
Methods
protected
- onBeforeWrite() — Handles the default tax rate before writing
public
- fieldLabels() — Field labels for display in tables.
- getCMSFields() — customizes the backends fields, mainly for ModelAdmin
- getDefault() — Returns the default tax rate
- getIsDefaultString() — Casting to get the IsDefault state as a readable string
- getTaxRate() — determine the tax rate. This method can be extended via DataExtension to implement project specific behavior.
- getTitle() — retirieves title from related language class depending on the set locale
- plural_name() — Returns the translated plural name of the object.
- presetDropdownWithDefault() — Presets the given dropdown field with the default tax rate
- setI18nTitle() — Sets the i18n title only. Won't be saved.
- setTitle() — Sets the title
- singular_name() — Returns the translated singular name of the object.
- 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.