- Class name: CurrencyCore
- Parent class: ObjectModel
- Source: classes/Currency.php line 27
- $active
- $blank
- $conversion_rate
- $currencies
- $decimals
- $definition
- $deleted
- $format
- $id
- $iso_code
- $iso_code_num
- $name
- $prefix
- $sign
- $suffix
- $webserviceParameters
- $db
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $get_shop_from_context
- $id_lang
- $id_shop
- $id_shop_list
- $identifier
- $image_dir
- $image_format
- $table
- $tables
- $update_fields
- __construct
- add
- addFieldsRequiredDatabase
- associateTo
- checkPaymentCurrencies
- clearCache
- delete
- deleteImage
- deleteSelection
- displayFieldName
- duplicateObject
- duplicateShops
- exists
- existsInDatabase
- formatFields
- formatValue
- getAssociatedShops
- getCurrencies
- getCurrenciesByIdShop
- getCurrency
- getCurrencyInstance
- getCurrent
- getDefaultCurrency
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getIdByIsoCode
- getIdByIsoCodeNum
- getIdByQuery
- getPaymentCurrencies
- getPaymentCurrenciesSpecial
- getSign
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- hasMultishopEntries
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isLangMultishop
- isMultishop
- makeTranslationFields
- refreshCurrencies
- refreshCurrency
- save
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- toggleStatus
- update
- updateMultishopTable
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
public integer $active
- Visibility: public
- Source: classes/Currency.php line 59.
public integer $blank
- Visibility: public
- Source: classes/Currency.php line 44.
public string $conversion_rate
- Visibility: public
- Source: classes/Currency.php line 47.
protected array $currencies = array()
- Visibility: protected
- This property is static.
- Source: classes/Currency.php line 83.
public integer $decimals
- Visibility: public
- Source: classes/Currency.php line 56.
public mixed $definition = array('table' => 'currency', 'primary' => 'id_currency', 'multilang_shop' => true, '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' => 3), 'iso_code_num' => array('type' => self::TYPE_STRING, 'validate' => 'isNumericIsoCode', 'size' => 3), 'blank' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'sign' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 8), 'format' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'decimals' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'conversion_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true, 'shop' => true), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')))
- Visibility: public
- This property is static.
- Source: classes/Currency.php line 64.
public boolean $deleted
- Visibility: public
- Source: classes/Currency.php line 50.
public integer $format
- Visibility: public
- Source: classes/Currency.php line 53.
public mixed $id
- Visibility: public
- Source: classes/Currency.php line 29.
public string $iso_code
- Visibility: public
- Source: classes/Currency.php line 35.
public string $iso_code_num
- Visibility: public
- Source: classes/Currency.php line 38.
public string $name
- Visibility: public
- Source: classes/Currency.php line 32.
public string $prefix = null
contains the sign to display before price, according to its format
- Visibility: public
- Source: classes/Currency.php line 93.
public string $sign
- Visibility: public
- Source: classes/Currency.php line 41.
public string $suffix = null
contains the sign to display after price, according to its format
- Visibility: public
- Source: classes/Currency.php line 98.
protected mixed $webserviceParameters = array('objectsNodeName' => 'currencies')
- Visibility: protected
- Source: classes/Currency.php line 85.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 140.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 80.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 65.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 95.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 85.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 100.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 90.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 105.
protected mixed $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 63.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 57.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 59.
public mixed $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 61.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 75.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 116.
protected string $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 119.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 70.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 110.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 135.
mixed CurrencyCore::__construct($id, $id_lang, $id_shop)
- Visibility: public
- Source: classes/Currency.php line 100
- $id mixed
- $id_lang mixed
- $id_shop mixed
mixed CurrencyCore::add($autodate, $nullValues)
Overriding check if currency with the same iso code already exists.
If it's true, currency is doesn't added.
- Visibility: public
- Source: classes/Currency.php line 114
- $autodate mixed
- $nullValues mixed
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1146
- $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 1193
- $id_shops integer|array
mixed CurrencyCore::checkPaymentCurrencies($id_module, $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 256
- $id_module mixed
- $id_shop mixed
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1160
- $all mixed
mixed CurrencyCore::delete()
- Visibility: public
- Source: classes/Currency.php line 155
boolean ObjectModelCore::deleteImage($force_delete)
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1319
- $force_delete mixed
mixed CurrencyCore::deleteSelection($selection)
- Visibility: public
- Source: classes/Currency.php line 138
- $selection mixed
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 939
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
\new ObjectModelCore::duplicateObject()
Duplicate current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 528
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1237
- $id mixed
boolean CurrencyCore::exists(integer|string $iso_code, $iso_code_num, $id_shop)
Check if a curency already exists.
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 125
- $iso_code integer|string - int for iso code number string for iso code
- $iso_code_num mixed
- $id_shop mixed
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 1356
- $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 335
- $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)
Format a data
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 381
- $value mixed
- $type integer
- $with_quotes mixed
array ObjectModelCore::getAssociatedShops()
Get the list of associated id_shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1222
array CurrencyCore::getCurrencies($object, $active)
Return available currencies
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 199
- $object mixed
- $active mixed
mixed CurrencyCore::getCurrenciesByIdShop($id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 215
- $id_shop mixed
mixed CurrencyCore::getCurrency($id_currency)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 271
- $id_currency mixed
mixed CurrencyCore::getCurrencyInstance($id)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 411
- $id mixed
\Currency CurrencyCore::getCurrent()
Get current currency
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 405
mixed CurrencyCore::getDefaultCurrency()
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 372
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 1462
- $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 1569
- $field_name mixed
- $id_lang null
array ObjectModelCore::getFields()
Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval.
..)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 263
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 300
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1138
- $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 286
integer CurrencyCore::getIdByIsoCode($iso_code, integer $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 286
- $iso_code mixed
- $id_shop integer
integer CurrencyCore::getIdByIsoCodeNum($iso_code_num, integer $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 300
- $iso_code_num mixed
- $id_shop integer
\DbQuery CurrencyCore::getIdByQuery(integer $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 313
- $id_shop integer
mixed CurrencyCore::getPaymentCurrencies($id_module, $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 240
- $id_module mixed
- $id_shop mixed
mixed CurrencyCore::getPaymentCurrenciesSpecial($id_module, $id_shop)
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 228
- $id_module mixed
- $id_shop mixed
string CurrencyCore::getSign(string $side)
Return formated sign
- Visibility: public
- Source: classes/Currency.php line 174
- $side string - left or right
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 769
- $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 148
- $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 1080
- $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 1006
- $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 1262
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 1394
- $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 1413
- $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 1175
- $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 1374
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1274
mixed ObjectModelCore::isMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1269
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 785
- $fields mixed
- $fields_array mixed
- $id_language mixed
mixed CurrencyCore::refreshCurrencies()
- Visibility: public
- This method is static.
- Source: classes/Currency.php line 381
mixed CurrencyCore::refreshCurrency($data, $isoCodeSource, $defaultCurrency)
Refresh the currency conversion rate The XML file define conversion rate for each from a default currency ($isoCodeSource).
- Visibility: public
- Source: classes/Currency.php line 336
- $data mixed - XML content which contains all the conversion rates
- $isoCodeSource mixed - The default currency used in the XML file
- $defaultCurrency mixed - The default currency object
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 425
- $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 1500
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 1595
- $fields array
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 753
boolean ObjectModelCore::update(boolean $null_values)
Update current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 577
- $null_values boolean
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 1289
- $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 954
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 960
- $htmlentities mixed
boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 892
- $field string - Field name
- $value mixed - Field value
- $id_lang integer
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 823
- $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 852
- $die boolean
- $error_return boolean
mixed ObjectModelCore::validateFieldsRequiredDatabase($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1116
- $htmlentities mixed