SilverCart\Admin\Model\SiteConfigExtension
This class is used to add SilverCart configuration options and a translation section to the original SiteConfig object in the cms section.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class SiteConfigExtension
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $defaults = ;
- protected boolean $getCMSFieldsIsCalled = false;
- private static $duplicate_config_locale = NULL;
- // methods
- public void setOwner()
- public false canCreate()
- public bool canDelete()
- public bool canTranslate()
- public void updateFieldLabels()
- public void updateCMSFields()
- public FieldList getCMSFieldsForSilvercart()
- public void getCMSFieldsForColorScheme()
- public void onBeforeWrite()
- public void onAfterWrite_deprecated()
- public void requireDefaultRecords()
- public string getWeightUnitNice()
- public string getDimensionUnitNice()
- public bool getEnableSSL()
- public array checkActiveCountries()
- public string|null getUpdatedField()
- public string|null getShopName()
- public string|null getShopStreet()
- public string|null getShopStreetNumber()
- public string|null getShopPostcode()
- public string|null getShopCity()
- public Country ShopCountry()
- public Country getShopCountry()
- public string|null getShopPhone()
- public string|null getShopEmail()
- public string|null getShopOpeningHours()
- public string|null getShopAdditionalInfo()
- public string|null getShopAdditionalInfo2()
- public string|null getDefaultMailOrderNotificationRecipient()
- public string|null getDefaultMailRevocationRecipient()
- public string|null getDefaultMailRegistrationRecipient()
- public string|null getDefaultContactMessageRecipient()
- // Inherited methods from ExtensibleExtension
- public void customAddCallbackMethod()
Hierarchy
Members
private
- $db
—
array
DB attributes - $defaults
—
array
Defaults for empty fields. - $duplicate_config_locale
—
string
Will hold the Locale of the SiteConfig object to be written. - $has_one
—
array
Has-one relationships.
protected
- $customAddCallbackMethodList
—
array
Lsit of custom callback methods. - $getCMSFieldsIsCalled
—
boolean
Indicator to check whether getCMSFields is called
Methods
public
- ShopCountry() — Returns the ShopCountry with extension support.
- canCreate() — There is only one config object which is created on installation.
- canDelete() — Remove permission to delete for all members.
- canTranslate() — Indicates that the config is translatable
- checkActiveCountries() — Checks, whether an activated country exists or not.
- getCMSFieldsForColorScheme() — Adds the CMS fields for the ColorScheme setting.
- getCMSFieldsForSilvercart() — Builds and returns the CMS fields.
- getDefaultContactMessageRecipient() — Returns the DefaultContactMessageRecipient.
- getDefaultMailOrderNotificationRecipient() — Returns the DefaultMailOrderNotificationRecipient.
- getDefaultMailRegistrationRecipient() — Returns the DefaultMailRegistrationRecipient.
- getDefaultMailRevocationRecipient() — Returns the DefaultMailRevocationRecipient.
- getDimensionUnitNice() — Returns the i18n dimension unit.
- getEnableSSL() — Returns whether to enable SSL.
- getShopAdditionalInfo() — Returns the ShopAdditionalInfo.
- getShopAdditionalInfo2() — Returns the ShopAdditionalInfo2.
- getShopCity() — Returns the ShopCity.
- getShopCountry() — Returns the ShopCountry with extension support.
- getShopEmail() — Returns the ShopEmail.
- getShopName() — Returns the ShopName.
- getShopOpeningHours() — Returns the ShopOpeningHours.
- getShopPhone() — Returns the ShopPhone.
- getShopPostcode() — Returns the ShopPostcode.
- getShopStreet() — Returns the ShopStreet.
- getShopStreetNumber() — Returns the ShopStreetNumber.
- getUpdatedField() — Returns the updated field value for the given $fieldName.
- getWeightUnitNice() — Returns the i18n weight unit.
- onAfterWrite_deprecated() — Duplicates the SilverCart based config into the translations.
- onBeforeWrite() — Sets the ColorScheme.
- requireDefaultRecords() — Restores the config parameters out of the old SilvercartConfig object.
- setOwner() — Workaround to add a custom callback method for ShopState if possible.
- updateCMSFields() — Adds a translation section
- updateFieldLabels() — Updates the fields labels
Inherited from SilverCart\Core\ExtensibleExtension
public
- customAddCallbackMethod() — Adds a callback for the given $method name. If $extensionClass is not given self::class will be used as fallback.