SilverCart\Model\Customer\Country
Abstract for a country.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class Country
extends DataObject
{
- // members
- private static array $db = ;
- private static array $defaults = ;
- 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 = "SilvercartCountry.Active DESC, SilvercartCountry.IsPrioritive DESC, SilvercartCountryTranslation.Title ASC";
- private static string $table_name = 'SilvercartCountry';
- private static bool $insert_translation_cms_fields = true;
- private static string $insert_translation_cms_fields_before = 'ISO2';
- protected static array $prioritiveCountries = ;
- protected static array $prioritiveCountryCount = ;
- protected static array $nonPrioritiveCountries = ;
- protected static array $nonPrioritiveCountryCount = ;
- protected static array $prioritiveDropdownMap = ;
- protected static SS_List $activeCountries = NULL;
- // methods
- public string singular_name()
- public string plural_name()
- public array fieldLabels()
- public array searchableFields()
- public string getFreeOfShippingCostsFromNice()
- public array summaryFields()
- public array excludeFromScaffolding()
- public FieldList getCMSFields()
- public void onBeforeWrite()
- public string getActivityText()
- public string getIsPrioritiveText()
- public string AttributedZones()
- public string AttributedPaymentMethods()
- public string getTitle()
- public static SS_List get_active()
- public static DataList getPrioritiveCountries()
- public static int getPrioritiveCountryCount()
- public static DataList getNonPrioritiveCountries()
- public static int getNonPrioritiveCountryCount()
- public static array getPrioritiveDropdownMap()
- public static void create_translations()
- // 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
- $belongs_many_many
—
array
Belongs-many-many relationships. - $casting
—
array
Virtual database columns. - $db
—
array
Attributes. - $default_sort
—
string
Default sort order and direction - $defaults
—
array
Default values - $has_many
—
array
Has-many relationship. - $insert_translation_cms_fields
—
SilverCart\Model\Customer\bool
Determines to insert the translation CMS fields by TranslatableDataObjectExtension. - $insert_translation_cms_fields_before
—
string
Determines to insert the translation CMS fields before this field. - $many_many
—
array
Many-many relationships. - $table_name
—
string
DB table name
protected
- $activeCountries
—
SilverStripe\ORM\SS_List
A DataList of all active countries or en empty ArrayList - $defaultFieldLabels
—
array
Default field labels. - $nonPrioritiveCountries
—
array
list of non prioritive countries - $nonPrioritiveCountryCount
—
array
count of non prioritive countries - $prioritiveCountries
—
array
list of prioritive countries - $prioritiveCountryCount
—
array
count of prioritive countries - $prioritiveDropdownMap
—
array
dropdown map sorted by prioritive countries
Methods
public
- AttributedPaymentMethods() — Returns the attributed payment methods as string (limited to 150 chars).
- AttributedZones() — Returns the attributed zones as string (limited to 150 chars).
- create_translations() — Creates the default translations for the given $targetLocale dependent on the given $existingLocale.
- 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() — i18n for field labels
- getActivityText() — Returns the text label for a countries activity.
- getCMSFields() — Returns the CMS fields.
- getFreeOfShippingCostsFromNice() — Returns freeOfShippingCostsFrom in a nice format
- getIsPrioritiveText() — Returns the text label for a countries priority.
- getNonPrioritiveCountries() — Returns a list of non prioritive countries
- getNonPrioritiveCountryCount() — Returns the count of non prioritive countries
- getPrioritiveCountries() — Returns a list of prioritive countries
- getPrioritiveCountryCount() — Returns the count of prioritive countries
- getPrioritiveDropdownMap() — Returns a dropdown map sorted by prioritive countries
- getTitle() — Returns the title
- get_active() — Returns all active countries
- onBeforeWrite() — Hook before writing th object
- plural_name() — Returns the translated plural name of the object. If no translation exists the class name will be returned.
- searchableFields() — Searchable fields of SilvercartCountry.
- singular_name() — Returns the translated singular name of the object. If no translation exists the class name will be returned.
- summaryFields() — Summary fields
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.