Properties

$id_customer

$id_customer : integer

Type

integer — Customer id which address belongs to

$id_manufacturer

$id_manufacturer : integer

Type

integer — Manufacturer id which address belongs to

$id_supplier

$id_supplier : integer

Type

integer — Supplier id which address belongs to

$id_warehouse

$id_warehouse : integer

Type

integer — Warehouse id which address belongs to

$id_country

$id_country : integer

Type

integer — Country id

$id_state

$id_state : integer

Type

integer — State id

$country

$country : string

Type

string — Country name

$alias

$alias : string

Type

string — Alias (eg. Home, Work...)

$company

$company : string

Type

string — Company (optional)

$lastname

$lastname : string

Type

string — Lastname

$firstname

$firstname : string

Type

string — Firstname

$address1

$address1 : string

Type

string — Address first line

$address2

$address2 : string

Type

string — Address second line (optional)

$postcode

$postcode : string

Type

string — Postal code

$city

$city : string

Type

string — City

$other

$other : string

Type

string — Any other useful information

$phone

$phone : string

Type

string — Phone number

$phone_mobile

$phone_mobile : string

Type

string — Mobile phone number

$vat_number

$vat_number : string

Type

string — VAT number

$dni

$dni : string

Type

string — DNI number

$date_add

$date_add : string

Type

string — Object creation date

$date_upd

$date_upd : string

Type

string — Object last modification date

$deleted

$deleted : boolean

Type

boolean — True if address has been deleted (staying in database as deleted)

$definition

$definition : 

Type

$_idZones

$_idZones : 

Type

$_idCountries

$_idCountries : 

Type

$_includeVars

$_includeVars : 

Type

$_includeContainer

$_includeContainer : 

Type

$webserviceParameters

$webserviceParameters : 

Type

Methods

__construct()

__construct(integer  $id_address = null,   $id_lang = null) 

Build an address

Parameters

integer $id_address

Existing address id in order to load object (optional)

$id_lang

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

update()

update(  $null_values = false) 

Parameters

$null_values

delete()

delete() 

getFieldsValidate()

getFieldsValidate() : array

Returns fields required for an address in an array hash

Returns

array —

hash values

validateController()

validateController(  $htmlentities = true) 

Parameters

$htmlentities

getZoneById()

getZoneById(integer  $id_address) : integer

Get zone id for a given address

Parameters

integer $id_address

Address id for which we want to get zone id

Returns

integer —

Zone id

isCountryActiveById()

isCountryActiveById(integer  $id_address) : integer

Check if country is active for a given address

Parameters

integer $id_address

Address id for which we want to get country status

Returns

integer —

Country status

isUsed()

isUsed() : integer

Check if address is used (at least one order placed)

Returns

integer —

Order count for this address

getCountryAndState()

getCountryAndState(  $id_address) 

Parameters

$id_address

addressExists()

addressExists(integer  $id_address) : boolean

Specify if an address is already in base

Parameters

integer $id_address

Address id

Returns

boolean

getFirstCustomerAddressId()

getFirstCustomerAddressId(  $id_customer,   $active = true) 

Parameters

$id_customer
$active

initialize()

initialize(integer  $id_address = null,   $with_geoloc = false) : \Address

Initiliaze an address corresponding to the specified id address or if empty to the default shop configuration

Parameters

integer $id_address
$with_geoloc

Returns

\Address —

address

getAddressIdBySupplierId()

getAddressIdBySupplierId(integer  $id_supplier) : integer

Returns id_address for a given id_supplier

Parameters

integer $id_supplier

Returns

integer —

$id_address

aliasExist()

aliasExist(  $alias,   $id_address,   $id_customer) 

Parameters

$alias
$id_address
$id_customer

getFieldsRequiredDB()

getFieldsRequiredDB()