Properties

$id_country

$id_country : integer

Type

integer — Country id which state belongs

$id_zone

$id_zone : integer

Type

integer — Zone id which state belongs

$iso_code

$iso_code : string

Type

string — 2 letters iso code

$name

$name : string

Type

string — Name

$active

$active : boolean

Type

boolean — Status for delivery

$definition

$definition : 

Type

$webserviceParameters

$webserviceParameters : 

Type

Methods

getStates()

getStates(  $id_lang = false,   $active = false) 

Parameters

$id_lang
$active

getNameById()

getNameById(integer  $id_state) : string

Get a state name with its ID

Parameters

integer $id_state

Country ID

Returns

string —

State name

getIdByName()

getIdByName(  $state) : integer

Get a state id with its name

Parameters

$state

Returns

integer —

state id

getIdByIso()

getIdByIso(string  $iso_code,   $id_country = null) : integer

Get a state id with its iso code

Parameters

string $iso_code

Iso code

$id_country

Returns

integer —

state id

delete()

delete() : boolean

Delete a state only if is not in use

Returns

boolean

isUsed()

isUsed() : boolean

Check if a state is used

Returns

boolean

countUsed()

countUsed() : integer

Returns the number of utilisation of a state

Returns

integer —

count for this state

getStatesByIdCountry()

getStatesByIdCountry(  $id_country) 

Parameters

$id_country

hasCounties()

hasCounties(  $id_state) 

Parameters

$id_state

getIdZone()

getIdZone(  $id_state) 

Parameters

$id_state

affectZoneToSelection()

affectZoneToSelection(  $ids_states,   $id_zone) : boolean

Parameters

$ids_states
$id_zone

Returns

boolean