SilverCart\Model\Translation\TranslationExtension
Adds methods that are common to all language classes e.g. ProductTranslation Updates CMS fields and brings the common attribute Locale.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class TranslationExtension
extends DataExtension
{
- // methods
- public void updateFieldLabels()
- public void canTranslate()
- public void updateSummaryFields()
- public void updateCMSFields()
- public string getNativeNameForLocale()
- public string getRelationClassName()
- public string getRelationFieldName()
- public array getTranslatedLocales()
- public DataList getTranslations()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $db
—
array
Extends the database fields - $indexes
—
array
Extends the db indexes
Methods
public
- canTranslate() — must return true for the LanguageDropdown field to work properly
- getNativeNameForLocale() — return the locale as native name
- getRelationClassName() — Returns the language class relation field name
- getRelationFieldName() — Returns the language class relation field name
- getTranslatedLocales() — Returns all translations for this DataObject as an array.
- getTranslations() — Returns all translations for this DataObject as DataList
- updateCMSFields() — adjust CMS fields for display in the popup window
- updateFieldLabels() — Field lable for Locale should always be multilingual
- updateSummaryFields() — The summary fields should at least show the locale