- Class name: CountryCore
- Parent class: ObjectModel
- Source: classes/Country.php line 27
- $_idZones
- $active
- $cache_iso_by_id
- $call_prefix
- $contains_states
- $definition
- $display_tax_label
- $id
- $id_currency
- $id_zone
- $iso_code
- $name
- $need_identification_number
- $need_zip_code
- $webserviceParameters
- $zip_code_format
- $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
- add
- addFieldsRequiredDatabase
- addModuleRestrictions
- affectZoneToSelection
- associateTo
- cacheFieldsRequiredDatabase
- checkZipCode
- clearCache
- containsStates
- delete
- deleteImage
- deleteSelection
- disableCache
- displayFieldName
- duplicateObject
- duplicateShops
- enableCache
- existsInDatabase
- formatFields
- formatValue
- getAssociatedShops
- getByIso
- getCountries
- getCountriesByIdShop
- getCountriesByZoneId
- getDefaultCountryId
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getIdByName
- getIdZone
- getIsoById
- getNameById
- getNeedZipCode
- getRepositoryClassName
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- getZipCodeFormat
- hasMultishopEntries
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isLangMultishop
- isMultiShopField
- isMultishop
- isNeedDni
- isNeedDniByCountryId
- makeTranslationFields
- save
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- toggleStatus
- update
- updateMultishopTable
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
protected mixed $_idZones = array()
- Visibility: protected
- This property is static.
- Source: classes/Country.php line 64.
public boolean $active = true
- Visibility: public
- Source: classes/Country.php line 62.
protected mixed $cache_iso_by_id = array()
- Visibility: protected
- This property is static.
- Source: classes/Country.php line 94.
public integer $call_prefix
- Visibility: public
- Source: classes/Country.php line 41.
public boolean $contains_states
- Visibility: public
- Source: classes/Country.php line 47.
public mixed $definition = array('table' => 'country', 'primary' => 'id_country', 'multilang' => true, 'fields' => array('id_zone' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'call_prefix' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'iso_code' => array('type' => self::TYPE_STRING, 'validate' => 'isLanguageIsoCode', 'required' => true, 'size' => 3), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'contains_states' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'need_identification_number' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'need_zip_code' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'zip_code_format' => array('type' => self::TYPE_STRING, 'validate' => 'isZipCodeFormat'), 'display_tax_label' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64)), 'associations' => array('zone' => array('type' => self::HAS_ONE), 'currency' => array('type' => self::HAS_ONE)))
- Visibility: public
- This property is static.
- Source: classes/Country.php line 69.
public boolean $display_tax_label = true
- Visibility: public
- Source: classes/Country.php line 59.
public mixed $id
- Visibility: public
- Source: classes/Country.php line 29.
public integer $id_currency
- Visibility: public
- Source: classes/Country.php line 35.
public integer $id_zone
- Visibility: public
- Source: classes/Country.php line 32.
public string $iso_code
- Visibility: public
- Source: classes/Country.php line 38.
public string $name
- Visibility: public
- Source: classes/Country.php line 44.
public boolean $need_identification_number
- Visibility: public
- Source: classes/Country.php line 50.
public boolean $need_zip_code
- Visibility: public
- Source: classes/Country.php line 53.
protected mixed $webserviceParameters = array('objectsNodeName' => 'countries', 'fields' => array('id_zone' => array('xlink_resource' => 'zones'), 'id_currency' => array('xlink_resource' => 'currencies')))
- Visibility: protected
- Source: classes/Country.php line 96.
public string $zip_code_format
- Visibility: public
- Source: classes/Country.php line 56.
protected boolean $cache_objects = true
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 164.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 156.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 150.
protected array $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 88.
protected array $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 70.
protected array $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 106.
protected array $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 94.
protected array $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 112.
protected array $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 100.
protected array $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 118.
public boolean $force_id = false
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 159.
protected boolean $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 67.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 58.
protected integer $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 61.
public array $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 64.
protected string $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 82.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130.
protected String $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 133.
protected array $loaded_classes = array()
Holds compiled definitions of each ObjectModel class.
Values are assigned during object initialization.
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 147.
protected string $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 76.
protected array $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 124.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 153.
mixed ObjectModelCore::__construct(integer|null $id, integer|null $id_lang, integer|null $id_shop)
Builds the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 201
- $id integer|null - If specified, loads and existing object from DB (optional).
- $id_lang integer|null - Required if object is multilingual (optional).
- $id_shop integer|null - ID shop for objects with multishop tables.
mixed CountryCore::add($autodate, $null_values)
- Visibility: public
- Source: classes/Country.php line 382
- $autodate mixed
- $null_values mixed
boolean ObjectModelCore::addFieldsRequiredDatabase(array $fields)
Sets required field for this class in the database.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1340
- $fields array
mixed CountryCore::addModuleRestrictions(array $shops, array $countries, array $modules)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 356
- $shops array
- $countries array
- $modules array
boolean CountryCore::affectZoneToSelection($ids_countries, $id_zone)
- Visibility: public
- Source: classes/Country.php line 330
- $ids_countries mixed
- $id_zone mixed
boolean|void 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 1408
- $id_shops integer|array
mixed ObjectModelCore::cacheFieldsRequiredDatabase(boolean $all)
Caches data about required objects fields in memory
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1319
- $all boolean - If true, caches required fields of all object classes.
\(bool) CountryCore::checkZipCode($zip_code)
Replace letters of zip code format And check this format on the zip code
- Visibility: public
- Source: classes/Country.php line 344
- $zip_code mixed
mixed ObjectModelCore::clearCache(boolean $all)
Clears cache entries that have this object's ID.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1360
- $all boolean - If true, clears cache for all objects
mixed CountryCore::containsStates($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 317
- $id_country mixed
mixed CountryCore::delete()
- Visibility: public
- Source: classes/Country.php line 104
boolean ObjectModelCore::deleteImage(boolean $force_delete)
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1585
- $force_delete boolean
boolean ObjectModelCore::deleteSelection(array $ids)
Deletes multiple objects from the database at once
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 765
- $ids array - Array of objects IDs.
mixed ObjectModelCore::disableCache()
Disables object caching
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1892
string ObjectModelCore::displayFieldName(string $field, string $class, boolean $htmlentities, \Context|null $context)
Returns field name translation
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1051
- $field string - Field name
- $class string - ObjectModel class name
- $htmlentities boolean - If true, applies htmlentities() to result string
- $context Context|null - Context object
\ObjectModel|false ObjectModelCore::duplicateObject()
Takes current object ID, gets its values from database, saves them in a new row and loads newly saved values as a new object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 534
boolean|void ObjectModelCore::duplicateShops($id)
Copies shop association data from object with specified ID.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1462
- $id mixed
mixed ObjectModelCore::enableCache()
Enables object caching
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1884
boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)
Checks if an object exists in database.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1624
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $type, integer $id_lang)
Formats values of each fields.
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 322
- $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, boolean $with_quotes, boolean $purify, boolean $allow_null)
Formats a value
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 373
- $value mixed
- $type integer
- $with_quotes boolean
- $purify boolean
- $allow_null boolean
array ObjectModelCore::getAssociatedShops()
Gets the list of associated shop IDs
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1440
integer CountryCore::getByIso(string $iso_code, boolean $active)
Get a country ID with its iso code
- Visibility: public
- This method is static.
- Source: classes/Country.php line 161
- $iso_code string - Country iso code
- $active boolean - return only active coutries
Array CountryCore::getCountries(integer $id_lang, boolean $active, boolean $contain_states, boolean $list_states)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 121
- $id_lang integer - Language ID
- $active boolean - return only active coutries
- $contain_states boolean - return only country with states
- $list_states boolean - Include the states list with the returned list
mixed CountryCore::getCountriesByIdShop($id_shop, $id_lang)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 144
- $id_shop mixed
- $id_lang mixed
mixed CountryCore::getCountriesByZoneId($id_zone, $id_lang)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 289
- $id_zone mixed
- $id_lang mixed
integer CountryCore::getDefaultCountryId()
Returns the default country Id
- Visibility: public
- This method is static.
- Source: classes/Country.php line 283
array ObjectModelCore::getDefinition(string $class, string|null $field)
Returns object definition
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1740
- $class string - Name of object
- $field string|null - Name of field if we want the definition of one field only
mixed ObjectModelCore::getFieldByLang(string $field_name, integer|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 1849
- $field_name string
- $id_lang integer|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 243
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 284
array|null ObjectModelCore::getFieldsRequiredDatabase(boolean $all)
Returns an array of required fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1306
- $all boolean - If true, returns required fields of all object classes.
array ObjectModelCore::getFieldsShop()
Prepare fields for multishop Fields are not validated here, we consider they are already validated in getFields() method, this is 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 267
integer CountryCore::getIdByName(integer $id_lang, string $country)
Get a country id with its name
- Visibility: public
- This method is static.
- Source: classes/Country.php line 241
- $id_lang integer - Language ID
- $country string - Country Name
mixed CountryCore::getIdZone($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 174
- $id_country mixed
string CountryCore::getIsoById(integer $id_country)
Get a country iso with its ID
- Visibility: public
- This method is static.
- Source: classes/Country.php line 221
- $id_country integer - Country ID
string CountryCore::getNameById(integer $id_lang, integer $id_country)
Get a country name with its ID
- Visibility: public
- This method is static.
- Source: classes/Country.php line 198
- $id_lang integer - Language ID
- $id_country integer - Country ID
mixed CountryCore::getNeedZipCode($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 255
- $id_country mixed
mixed ObjectModelCore::getRepositoryClassName()
Returns the name of the repository class for this entity.
If unspecified, a generic repository will be used for the entity.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 166
array ObjectModelCore::getTranslationsFields(array $fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 806
- $fields_array array
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 178
- $class string - Child class name for static use (optional)
array|null ObjectModelCore::getWebserviceObjectList(string $sql_join, string $sql_filter, string $sql_sort, string $sql_limit)
Returns webservice object list.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1230
- $sql_join string
- $sql_filter string
- $sql_sort string
- $sql_limit string
array ObjectModelCore::getWebserviceParameters(string|null $ws_params_attribute_name)
Returns webservice parameters of this object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1140
- $ws_params_attribute_name string|null
mixed CountryCore::getZipCodeFormat($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 266
- $id_country mixed
boolean ObjectModelCore::hasMultishopEntries()
Checks if there is more than one entry in associated shop table for current object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1488
mixed ObjectModelCore::hydrate(array $data, integer|null $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 1666
- $data array
- $id_lang integer|null
array ObjectModelCore::hydrateCollection(string $class, array $datas, integer|null $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 1688
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer|null
boolean ObjectModelCore::isAssociatedToShop(integer|null $id_shop)
Checks if current object is associated to a shop.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1375
- $id_shop integer|null
boolean ObjectModelCore::isCurrentlyUsed(string|null $table, boolean $has_active_column)
Checks if an object type exists in the database.
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1644
- $table string|null - Name of table linked to entity
- $has_active_column boolean - True if the table has an active column
boolean ObjectModelCore::isLangMultishop()
Checks if the object is both multi-language and multi-shop.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1523
boolean ObjectModelCore::isMultiShopField(string $field)
Checks if a field is a multi-shop field.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1513
- $field string
boolean ObjectModelCore::isMultishop()
Checks if object is multi-shop object.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1501
mixed CountryCore::isNeedDni()
- Visibility: public
- Source: classes/Country.php line 304
mixed CountryCore::isNeedDniByCountryId($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 309
- $id_country mixed
mixed ObjectModelCore::makeTranslationFields(array $fields, array $fields_array, integer $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 827
- $fields array
- $fields_array array
- $id_language integer
boolean ObjectModelCore::save(boolean $null_values, boolean $auto_date)
Saves current object to database (add or update)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 429
- $null_values boolean
- $auto_date boolean
mixed ObjectModelCore::setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1778
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 1876
- $fields array
boolean ObjectModelCore::toggleStatus()
Toggles object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 783
boolean ObjectModelCore::update(boolean $null_values)
Updates the current object in the database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 597
- $null_values boolean
boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)
Updates 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 1539
- $classname string
- $data array
- $where string
- $specific_where string - Only executed for common table
array ObjectModelCore::validateControler(boolean $htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1071
- $htmlentities boolean
array ObjectModelCore::validateController(boolean $htmlentities)
Validates submitted values and returns an array of errors, if any.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1084
- $htmlentities boolean - If true, uses htmlentities() for field name translations in errors.
true|string ObjectModelCore::validateField(string $field, mixed $value, integer|null $id_lang, array $skip, boolean $human_errors)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 946
- $field string - Field name
- $value mixed - Field value
- $id_lang integer|null - Language ID
- $skip array - Array of fields to skip.
- $human_errors boolean - If true, uses more descriptive, translatable error strings.
boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)
Checks if object field values are valid before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 867
- $die boolean
- $error_return boolean
boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)
Checks if multilingual object field values are valid before database interaction.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 898
- $die boolean
- $error_return boolean
array ObjectModelCore::validateFieldsRequiredDatabase(boolean $htmlentities)
Validate required fields.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1275
- $htmlentities boolean