SilverCart\Model\Translation\TranslatableDataObjectExtension
Extends DataObjects to make them multilingual.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class TranslatableDataObjectExtension
extends DataExtension
{
- // members
- protected array $translationCache = ;
- // methods
- public void updateCMSFields()
- public void augmentSQL()
- public string getLocaleDependentSelect()
- public string getTranslationFieldValue()
- public DataObject getTranslation()
- public string getBaseClassName()
- public string getBaseTableName()
- public string getClassName()
- public string getTableName()
- public string getTranslationClassName()
- public string getTranslationTableName()
- public string getBaseTranslationClassName()
- public string getBaseTranslationTableName()
- public HasManyList getTranslationRelation()
- public string getTranslationRelationName()
- public string getRelationFieldName()
- public bool translationFieldValueIsChanged()
- public bool hasTranslation()
- public bool hasCurrentTranslation()
- public DataObject getTranslationFor()
- public HasManyList getTranslations()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void onBeforeDelete()
- public void onBeforeDuplicate()
- public void onAfterDuplicate()
- public bool isEmptyMultilingualAttributes()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
protected
- $translationCache
—
array
The translation object list
Methods
public
- augmentSQL() — Manipulates the SQL query
- getBaseClassName() — Returns the base class name of the owner used for SQL
- getBaseTableName() — Returns the base table name of the owner used for SQL
- getBaseTranslationClassName() — Returns the translation base class
- getBaseTranslationTableName() — Returns the translation base table name.
- getClassName() — Returns the class name
- getLocaleDependentSelect() — Returns a locale dependent select statement (SQL)
- getRelationFieldName() — Returns the translation class relation field name
- getTableName() — Returns the table name
- getTranslation() — Getter for the related translation object depending on the set translation
- getTranslationClassName() — Returns the translation class name
- getTranslationFieldValue() — Returns the current translation context field value
- getTranslationFor() — Returns the translation for the given locale if exists
- getTranslationRelation() — Returns the translation relation as a ComponentSet
- getTranslationRelationName() — Returns the translation class relation name
- getTranslationTableName() — Returns the translation table name
- getTranslations() — Returns the translations for the extended object.
- hasCurrentTranslation() — Returns if there's a translation for the current locale.
- hasTranslation() — Checks whether the translation with the given locale exists
- isEmptyMultilingualAttributes() — determin wether all multilingual attributes for all existing translations are empty
- onAfterDuplicate() — Clones the translation data.
- onAfterWrite() — augments the hook of the decorated object so that the input in the fields that are multilingual gets written to the related translation object
- onBeforeDelete() — Deletes some relations
- onBeforeDuplicate() — Sets the property isActive to false.
- onBeforeWrite() — hook
- translationFieldValueIsChanged() — Checks whether the given translation field is changed.
- updateCMSFields() — Updates the CMS fields.