- Class name: LanguageCore
- Parent class: ObjectModel
- Source: classes/Language.php line 27
- $_LANGUAGES
- $_cache_language_installation
- $_checkedLangs
- $active
- $countActiveLanguages
- $date_format_full
- $date_format_lite
- $definition
- $id
- $is_rtl
- $iso_code
- $language_code
- $name
- $translationsFilesAndVars
- $webserviceParameters
- $cache_objects
- $db
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $force_id
- $get_shop_from_context
- $id_lang
- $id_shop
- $id_shop_list
- $identifier
- $image_dir
- $image_format
- $loaded_classes
- $table
- $tables
- $update_fields
- __construct
- _copyNoneFlag
- _generateFiles
- _getThemesList
- add
- addFieldsRequiredDatabase
- associateTo
- cacheFieldsRequiredDatabase
- checkAndAddLanguage
- checkFiles
- checkFilesWithIsoCode
- clearCache
- copyLanguageData
- countActiveLanguages
- delete
- deleteImage
- deleteSelection
- disableCache
- displayFieldName
- downloadAndInstallLanguagePack
- duplicateObject
- duplicateShops
- enableCache
- existsInDatabase
- formatFields
- formatValue
- getAssociatedShops
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getFilesList
- getIdByIso
- getIsoById
- getIsoIds
- getLanguage
- getLanguageByIETFCode
- getLanguageCodeByIso
- getLanguagePackListContent
- getLanguages
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- hasMultishopEntries
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isInstalled
- isLangMultishop
- isMultiLanguageActivated
- isMultiShopField
- isMultishop
- loadLanguages
- loadUpdateSQL
- makeTranslationFields
- moveToIso
- recurseDeleteDir
- save
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- toggleStatus
- update
- updateModulesTranslations
- updateMultishopTable
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
protected mixed $_LANGUAGES
- Visibility: protected
- This property is static.
- Source: classes/Language.php line 72.
protected mixed $_cache_language_installation = null
- Visibility: protected
- This property is static.
- Source: classes/Language.php line 802.
protected array $_checkedLangs
- Visibility: protected
- This property is static.
- Source: classes/Language.php line 71.
public boolean $active = true
- Visibility: public
- Source: classes/Language.php line 50.
protected mixed $countActiveLanguages = array()
- Visibility: protected
- This property is static.
- Source: classes/Language.php line 73.
public string $date_format_full = 'Y-m-d H:i:s'
- Visibility: public
- Source: classes/Language.php line 44.
public string $date_format_lite = 'Y-m-d'
- Visibility: public
- Source: classes/Language.php line 41.
public mixed $definition = array('table' => 'lang', 'primary' => 'id_lang', 'fields' => array('name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), 'iso_code' => array('type' => self::TYPE_STRING, 'validate' => 'isLanguageIsoCode', 'required' => true, 'size' => 2), 'language_code' => array('type' => self::TYPE_STRING, 'validate' => 'isLanguageCode', 'size' => 5), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'is_rtl' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_format_lite' => array('type' => self::TYPE_STRING, 'validate' => 'isPhpDateFormat', 'required' => true, 'size' => 32), 'date_format_full' => array('type' => self::TYPE_STRING, 'validate' => 'isPhpDateFormat', 'required' => true, 'size' => 32)))
- Visibility: public
- This property is static.
- Source: classes/Language.php line 55.
public mixed $id
- Visibility: public
- Source: classes/Language.php line 29.
public boolean $is_rtl = false
- Visibility: public
- Source: classes/Language.php line 47.
public string $iso_code
- Visibility: public
- Source: classes/Language.php line 35.
public string $language_code
- Visibility: public
- Source: classes/Language.php line 38.
public string $name
- Visibility: public
- Source: classes/Language.php line 32.
protected mixed $translationsFilesAndVars = array('fields' => '_FIELDS', 'errors' => '_ERRORS', 'admin' => '_LANGADM', 'pdf' => '_LANGPDF', 'tabs' => 'tabs')
- Visibility: protected
- Source: classes/Language.php line 80.
protected mixed $webserviceParameters = array('objectNodeName' => 'language', 'objectsNodeName' => 'languages')
- Visibility: protected
- Source: classes/Language.php line 75.
protected boolean $cache_objects = true
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 153.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 143.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 133.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 81.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 66.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 96.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 86.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 101.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 91.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 106.
public \boolean, $force_id = false
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 148.
protected mixed $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 64.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 58.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 60.
public mixed $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 62.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 76.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 117.
protected string $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 120.
protected mixed $loaded_classes = array()
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 128.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 71.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 111.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 138.
mixed LanguageCore::__construct($id, $id_lang)
- Visibility: public
- Source: classes/Language.php line 88
- $id mixed
- $id_lang mixed
mixed LanguageCore::_copyNoneFlag($id)
- Visibility: protected
- This method is static.
- Source: classes/Language.php line 797
- $id mixed
mixed LanguageCore::_generateFiles($newIso)
Generate translations files
- Visibility: protected
- Source: classes/Language.php line 110
- $newIso mixed
\array([theme LanguageCore::_getThemesList()
Return an array of theme
- Visibility: protected
- Source: classes/Language.php line 184
mixed LanguageCore::add($autodate, $nullValues, $only_add)
- Visibility: public
- Source: classes/Language.php line 199
- $autodate mixed
- $nullValues mixed
- $only_add mixed
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1244
- $fields mixed
boolean ObjectModelCore::associateTo(integer|array $id_shops)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1302
- $id_shops integer|array
mixed ObjectModelCore::cacheFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1231
- $all mixed
mixed LanguageCore::checkAndAddLanguage($iso_code, $lang_pack, $only_add, $params_lang)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 729
- $iso_code mixed
- $lang_pack mixed
- $only_add mixed
- $params_lang mixed
mixed LanguageCore::checkFiles()
- Visibility: public
- Source: classes/Language.php line 224
mixed LanguageCore::checkFilesWithIsoCode(mixed $iso_code)
This functions checks if every files exists for the language $iso_code.
Concerned files are those located in translations/$iso_code/ and translations/mails/$iso_code .
- Visibility: public
- This method is static.
- Source: classes/Language.php line 238
- $iso_code mixed
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1258
- $all mixed
mixed LanguageCore::copyLanguageData($from, $to)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 676
- $from mixed
- $to mixed
mixed LanguageCore::countActiveLanguages($id_shop)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 815
- $id_shop mixed
mixed LanguageCore::delete()
- Visibility: public
- Source: classes/Language.php line 484
boolean ObjectModelCore::deleteImage($force_delete)
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1433
- $force_delete mixed
mixed LanguageCore::deleteSelection($selection)
- Visibility: public
- Source: classes/Language.php line 557
- $selection mixed
mixed ObjectModelCore::disableCache()
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1719
mixed ObjectModelCore::displayFieldName($field, $class, $htmlentities, \Context $context)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1014
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
mixed LanguageCore::downloadAndInstallLanguagePack($iso, $version, $params, $install)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 829
- $iso mixed
- $version mixed
- $params mixed
- $install mixed
\new ObjectModelCore::duplicateObject()
Duplicate current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 549
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1346
- $id mixed
mixed ObjectModelCore::enableCache()
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1714
boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)
Specify if an ObjectModel is already in database
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1470
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $type, integer $id_lang)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 348
- $type integer - FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP
- $id_lang integer - If this parameter is given, only take lang fields
mixed ObjectModelCore::formatValue(mixed $value, integer $type, $with_quotes, $purify)
Format a data
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 395
- $value mixed
- $type integer
- $with_quotes mixed
- $purify mixed
array ObjectModelCore::getAssociatedShops()
Get the list of associated id_shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1331
array ObjectModelCore::getDefinition(string $class, string $field)
Get object definition
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1576
- $class string - Name of object
- $field string - Name of field if we want the definition of one field only
mixed ObjectModelCore::getFieldByLang($field_name, null $id_lang)
Return the field value for the specified language if the field is multilang, else the field value.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1683
- $field_name mixed
- $id_lang null
array LanguageCore::getFields()
- Visibility: public
- Source: classes/Language.php line 97
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 313
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1223
- $all mixed
array ObjectModelCore::getFieldsShop()
Prepare fields for multishop Fields are not validated here, we considere they are already validated in getFields() method, this not the best solution but this is the only one possible for retro compatibility.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 299
mixed LanguageCore::getFilesList($iso_from, $theme_from, $iso_to, $theme_to, $select, $check, $modules)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 250
- $iso_from mixed
- $theme_from mixed
- $iso_to mixed
- $theme_to mixed
- $select mixed
- $check mixed
- $modules mixed
integer LanguageCore::getIdByIso(string $iso_code)
Return id from iso code
- Visibility: public
- This method is static.
- Source: classes/Language.php line 619
- $iso_code string - Iso code
string LanguageCore::getIsoById(integer $id_lang)
Return iso code from id
- Visibility: public
- This method is static.
- Source: classes/Language.php line 606
- $id_lang integer - Language ID
array LanguageCore::getIsoIds($active)
Return array (id_lang, iso_code)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 671
- $active mixed
mixed LanguageCore::getLanguage($id_lang)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 593
- $id_lang mixed
mixed LanguageCore::getLanguageByIETFCode($code)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 635
- $code mixed
mixed LanguageCore::getLanguageCodeByIso($iso_code)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 627
- $iso_code mixed
mixed LanguageCore::getLanguagePackListContent($iso, $tar)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 928
- $iso mixed
- $tar mixed
array LanguageCore::getLanguages(boolean $active, $id_shop)
Return available languages
- Visibility: public
- This method is static.
- Source: classes/Language.php line 578
- $active boolean - Select only active languages
- $id_shop mixed
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 804
- $fields_array mixed
array ObjectModelCore::getValidationRules(string $class)
Returns object validation rules (fields validity)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 161
- $class string - Child class name for static use (optional)
mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1164
- $sql_join mixed
- $sql_filter mixed
- $sql_sort mixed
- $sql_limit mixed
mixed ObjectModelCore::getWebserviceParameters($ws_params_attribute_name)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1086
- $ws_params_attribute_name mixed
boolean ObjectModelCore::hasMultishopEntries()
Check if there is more than one entries in associated shop table for current entity
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1371
mixed ObjectModelCore::hydrate(array $data, integer $id_lang)
Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1508
- $data array
- $id_lang integer
array ObjectModelCore::hydrateCollection(string $class, array $datas, integer $id_lang)
Fill (hydrate) a list of objects in order to get a collection of these objects
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1527
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer
boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)
Check if current object is associated to a shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1273
- $id_shop integer
boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)
This method is allow to know if a entity is currently used
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1488
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
mixed LanguageCore::isInstalled($iso_code)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 803
- $iso_code mixed
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1388
boolean LanguageCore::isMultiLanguageActivated($id_shop)
Check if more on than one language is activated
- Visibility: public
- This method is static.
- Source: classes/Language.php line 923
- $id_shop mixed
mixed ObjectModelCore::isMultiShopField($field)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1383
- $field mixed
mixed ObjectModelCore::isMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1378
mixed LanguageCore::loadLanguages()
Load all languages in memory for caching
- Visibility: public
- This method is static.
- Source: classes/Language.php line 704
boolean LanguageCore::loadUpdateSQL()
loadUpdateSQL will create default lang values when you create a new lang, based on default id lang
- Visibility: public
- Source: classes/Language.php line 397
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 820
- $fields mixed
- $fields_array mixed
- $id_language mixed
mixed LanguageCore::moveToIso($newIso)
Move translations files after editing language iso code
- Visibility: public
- Source: classes/Language.php line 142
- $newIso mixed
mixed LanguageCore::recurseDeleteDir($dir)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 464
- $dir mixed
boolean ObjectModelCore::save(boolean $null_values, boolean $autodate)
Save current object to database (add or update)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 446
- $null_values boolean
- $autodate boolean
mixed ObjectModelCore::setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static Remove this in 1.6 !
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1614
mixed ObjectModelCore::setFieldsToUpdate(array $fields)
Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1709
- $fields array
mixed LanguageCore::toggleStatus()
- Visibility: public
- Source: classes/Language.php line 216
mixed LanguageCore::update($nullValues)
- Visibility: public
- Source: classes/Language.php line 721
- $nullValues mixed
mixed LanguageCore::updateModulesTranslations(array $modules_list)
- Visibility: public
- This method is static.
- Source: classes/Language.php line 940
- $modules_list array
boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)
Update a table and splits the common datas and the shop datas
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1403
- $classname string
- $data array
- $where string
- $specific_where string - Only executed for common table
mixed ObjectModelCore::validateControler($htmlentities)
TODO: refactor rename all calls to this to validateController
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1032
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1038
- $htmlentities mixed
boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang, $skip, $human_errors)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 931
- $field string - Field name
- $value mixed - Field value
- $id_lang integer
- $skip mixed
- $human_errors mixed
boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)
Check for fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 858
- $die boolean
- $error_return boolean
boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)
Check for multilingual fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 887
- $die boolean
- $error_return boolean
mixed ObjectModelCore::validateFieldsRequiredDatabase($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1200
- $htmlentities mixed