SilverCart\Model\Shipment\Zone
abstract for a shipping zone; makes it easier to calculate shipping rates.
Every carrier might have it´s own zones. That´s why zones:countries is n:m.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class Zone
extends DataObject
{
- // members
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static string $table_name = 'SilvercartZone';
- // methods
- public array fieldLabels()
- public FieldList getCMSFields()
- public string singular_name()
- public string plural_name()
- public string getTitle()
- public array searchableFields()
- public array summaryFields()
- protected void onBeforeWrite()
- public string AttributedCountries()
- public string AttributedShippingMethods()
- public string getCarriersAsString()
- public static DataList getZonesFor()
- public boolean hasAllCountries()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $belongs_many_many
—
array
Belongs-many-many relationships. - $casting
—
array
Virtual database columns. - $has_many
—
array
Has-many relationship. - $many_many
—
array
Many-many relationships. - $table_name
—
string
DB table name
Methods
protected
- onBeforeWrite() — Processing hook before writing the DataObject
public
- AttributedCountries() — Returns the attributed countries as string (limited to 150 chars).
- AttributedShippingMethods() — Returns the attributed shipping methods as string (limited to 150 chars).
- fieldLabels() — Field labels for display in tables.
- getCMSFields() — customizes the backends fields, mainly for ModelAdmin
- getCarriersAsString() — Returns the carriers as a comma separated string
- getTitle() — retirieves title from related language class depending on the set locale
- getZonesFor() — Returns all zones for the given country ID
- hasAllCountries() — Returns whether this zone is related to all active countries
- plural_name() — Returns the translated plural name of the object.
- searchableFields() — Searchable fields
- singular_name() — Returns the translated singular name of the object.
- summaryFields() — Summaryfields for display in tables.