- Class name: CountryCore
- Parent class: ObjectModel
- Source: classes/Country.php line 28
- $_idZones
- $active
- $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
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $id_lang
- $id_shop
- $identifier
- $image_dir
- $image_format
- $table
- $tables
- __construct
- add
- addFieldsRequiredDatabase
- affectZoneToSelection
- associateTo
- clearCache
- containsStates
- delete
- deleteImage
- deleteSelection
- displayFieldName
- duplicateShops
- existsInDatabase
- formatFields
- formatValue
- getByIso
- getCountries
- getCountriesByZoneId
- getDefaultCountryId
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getIdByName
- getIdZone
- getIsoById
- getNameById
- getNeedZipCode
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- getZipCodeFormat
- hydrate
- hydrateCollection
- isAssociatedToGroupShop
- isAssociatedToShop
- isCurrentlyUsed
- isLangMultishop
- isNeedDni
- isNeedDniByCountryId
- makeTranslationFields
- save
- setDefinitionRetrocompatibility
- toggleStatus
- update
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
protected mixed $_idZones = array()
- Visibility: protected
- This property is static.
- Source: classes/Country.php line 65.
public boolean $active = true
- Visibility: public
- Source: classes/Country.php line 63.
public integer $call_prefix
- Visibility: public
- Source: classes/Country.php line 42.
public boolean $contains_states
- Visibility: public
- Source: classes/Country.php line 48.
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 70.
public boolean $display_tax_label = true
- Visibility: public
- Source: classes/Country.php line 60.
public mixed $id
- Visibility: public
- Source: classes/Country.php line 30.
public integer $id_currency
- Visibility: public
- Source: classes/Country.php line 36.
public integer $id_zone
- Visibility: public
- Source: classes/Country.php line 33.
public string $iso_code
- Visibility: public
- Source: classes/Country.php line 39.
public string $name
- Visibility: public
- Source: classes/Country.php line 45.
public boolean $need_identification_number
- Visibility: public
- Source: classes/Country.php line 51.
public boolean $need_zip_code
- Visibility: public
- Source: classes/Country.php line 54.
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 95.
public string $zip_code_format
- Visibility: public
- Source: classes/Country.php line 57.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 122.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 72.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 57.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 87.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 77.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 92.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 82.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 97.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 51.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 53.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 67.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 108.
protected string $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 111.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 62.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 102.
mixed ObjectModelCore::__construct(integer $id, integer $id_lang, integer $id_shop)
Build object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 150
- $id integer - Existing object id in order to load object (optional)
- $id_lang integer - Required if object is multilingual (optional)
- $id_shop integer - ID shop for objects with multishop on langs
boolean ObjectModelCore::add(boolean $autodate, boolean $null_values)
Add current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 372
- $autodate boolean
- $null_values boolean
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 925
- $fields mixed
boolean CountryCore::affectZoneToSelection($ids_countries, $id_zone)
- Visibility: public
- Source: classes/Country.php line 322
- $ids_countries mixed
- $id_zone mixed
boolean ObjectModelCore::associateTo(integer|array $id_shops, string $type)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 973
- $id_shops integer|array
- $type string
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 939
- $all mixed
mixed CountryCore::containsStates($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 309
- $id_country mixed
mixed CountryCore::delete()
- Visibility: public
- Source: classes/Country.php line 103
boolean ObjectModelCore::deleteImage()
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1047
boolean ObjectModelCore::deleteSelection(array $selection)
Delete several objects from database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 559
- $selection array
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 757
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1017
- $id 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 1081
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $id_lang)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 272
- $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 319
- $value mixed
- $type integer
- $with_quotes mixed
integer CountryCore::getByIso(string $iso_code)
Get a country ID with its iso code
- Visibility: public
- This method is static.
- Source: classes/Country.php line 156
- $iso_code string - Country iso code
array CountryCore::getCountries(integer $id_lang, boolean $active, $contain_states, \Shop $shop)
Return available countries
- Visibility: public
- This method is static.
- Source: classes/Country.php line 117
- $id_lang integer - Language ID
- $active boolean - return only active coutries
- $contain_states mixed
- $shop Shop
mixed CountryCore::getCountriesByZoneId($id_zone, $id_lang, \Shop $shop)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 278
- $id_zone mixed
- $id_lang mixed
- $shop Shop
integer CountryCore::getDefaultCountryId()
Returns the default country Id
- Visibility: public
- This method is static.
- Source: classes/Country.php line 272
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 1184
- $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 1261
- $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 234
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 249
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 917
- $all mixed
\intval 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 230
- $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 168
- $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 212
- $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 192
- $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 244
- $id_country mixed
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 595
- $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 130
- $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 890
- $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 816
- $ws_params_attribute_name mixed
mixed CountryCore::getZipCodeFormat($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 255
- $id_country mixed
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 1116
- $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 1135
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer
boolean ObjectModelCore::isAssociatedToGroupShop(integer $id_group_shop)
Check if current object is associated to a group shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1003
- $id_group_shop 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 954
- $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 1099
- $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 1037
mixed CountryCore::isNeedDni()
- Visibility: public
- Source: classes/Country.php line 296
mixed CountryCore::isNeedDniByCountryId($id_country)
- Visibility: public
- This method is static.
- Source: classes/Country.php line 301
- $id_country mixed
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 611
- $fields mixed
- $fields_array mixed
- $id_language 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 360
- $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 1207
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 575
boolean ObjectModelCore::update(boolean $null_values)
Update current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 446
- $null_values boolean
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 772
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 778
- $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 710
- $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 649
- $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 675
- $die boolean
- $error_return boolean