Comments: on this page. Click to read or post your own.
The {Translatable} decorator allows your DataObjects to have versions in different languages, defining which fields are can be translated.
Common language names (e.g. 'en') are used in {Translatable} for database-entities. On the other hand, the file-based i18n-translations always have a "locale" (e.g. 'en_US').
You can enable {Translatabe} for any DataObject-subclass: <example> static $extensions = array( "Translatable('MyTranslatableVarchar', 'OtherTranslatableText')" ); </example>
Caution: Does not apply any character-set conversion, it is assumed that all content is stored and represented in UTF-8 (Unicode). Please make sure your database and HTML-templates adjust to this.
Caution: Further decorations of DataObject might conflict with this implementation, e.g. when overriding the get_one()-calls (which are already extended by {Translatable}).
Located in /sapphire/core/model/Translatable.php (line 28)
Object | --Extension | --DataObjectDecorator | --Translatable
Indicates whether the 'Lang' transformation when modifying queries should be bypassed If it's true
Dataobject's original ID when we're creating a new language version of an object
The 'default' language.
Indicates if the multilingual feature is enabled
Indicates if the start language has been determined using choose_site_lang
The language in which we are reading dataobjects.
Usually stored in session, specific to the "site mode": either 'site' or 'cms'.
A cached list of existing tables
A map of the field values of the original (untranslated) DataObject record
An array of fields that can be translated.
Inherited from DataObjectDecorator
DataObjectDecorator::$decoratable_statics
Inherited from Extension
Extension::$allowed_actions
Extension::$owner
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Choose the language the site is currently on.
If $_GET['lang'] or $_COOKIE['lang'] is set, then it will use that language, and store it in the session. Otherwise it checks the session for a possible stored language, either from namespace to the site_mode ('site' or 'cms'), or for a 'global' language setting. The final option is the member preference.
When creating, set the original ID value
Get the current reading language.
Get the current reading language.
Disable the multilingual feature
Enables the multilingual feature
Get all the instances of the given class translated to the given language
Get a list of languages in which a given element has been translated
Get a singleton instance of a class in the most convenient language (@see choose_site_lang())
Get a singleton instance of a class in the given language.
Get a record in his original language version.
Check whether the default and current reading language are the same.
Check whether multilingual support has been enabled
Set default language.
Set the reading language, either namespaced to 'site' (website content) or 'cms' (management backend).
Checks if a table given table exists in the db
Writes an object in a certain language. Use this instead of $object->write() if you want to write an instance in a determinated language independently of the currently set working language
Construct a new Translatable object.
Get a list of fields in the {$table}_lang table
Augment a write-record request.
Return the base table - the class that directly extends DataObject.
Extends $table with a suffix if required
Get a list of fields from the tables created by this extension
Determine if the DataObject has any own translatable field (not inherited).
Check whether a WHERE clause should be applied to the augmented table
Determine if a table needs Versioned support This is called at db/build time
Change the member dialog in the CMS
This method updates the forms in the cms to allow the translations for the defined translatable fields.
Inherited From DataObjectDecorator
DataObjectDecorator::augmentDatabase()
DataObjectDecorator::augmentSQL()
DataObjectDecorator::augmentWrite()
DataObjectDecorator::extraDBFields()
DataObjectDecorator::loadExtraDBFields()
DataObjectDecorator::updateCMSFields()
DataObjectDecorator::updateFormFields()
DataObjectDecorator::updateSummaryFields()
DataObjectDecorator::updateSummaryFieldsExcludeExtra()
Inherited From Extension
Extension::setOwner()
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Sun, 19 Oct 2008 06:47:10 +1300 by phpDocumentor 1.3.2