Properties

$company

$company : string

A company name

Type

string

$firstname

$firstname : string

A first/given name

Type

string

$lastname

$lastname : string

A last/surname

Type

string

$address1

$address1 : string

An address

Type

string

$address2

$address2 : string

An address

Type

string

$city

$city : string

A city name

Type

string

$state

$state : string

A state name or code

Type

string

$postal

$postal : string

A postal/zip code

Type

string

$country

$country : string

A country code (or name, but usually a code)

Type

string

$phoen

$phoen : string

A phone number

Type

string

$fax

$fax : string

A fax number

Type

string

$email

$email : string

An email address

Type

string

Methods

set_company()

set_company(string  $str) 

Set the company name for this address.

Parameters

string $str

get_company()

get_company() : string

Return the company name (if any) associated with this address.

Returns

string

set_firstname()

set_firstname(string  $str) 

Set the first name for this address.

Parameters

string $str

get_firstname()

get_firstname() : string

Return the first name (if any) associated with this address.

Returns

string

set_lastname()

set_lastname(string  $str) 

Set the last name for this address.

Parameters

string $str

get_lastname()

get_lastname() : string

Return the last name (if any) associated with this address.

Returns

string

set_address1()

set_address1(string  $str) 

Set the first address line for this address.

Parameters

string $str

get_address1()

get_address1() : string

Return the first address line (if any) associated with this address.

Returns

string

set_address2()

set_address2(string  $str) 

Set the second address line for this address.

Parameters

string $str

get_address2()

get_address2() : string

Return the second address line (if any) associated with this address.

Returns

string

set_city()

set_city(string  $str) 

Set the city for this address.

Parameters

string $str

get_city()

get_city() : string

Return the city (if any) associated with this address.

Returns

string

set_state()

set_state(string  $str) 

Set the state for this address.

Parameters

string $str

get_state()

get_state() : string

Return the state (if any) associated with this address.

Returns

string

set_postal()

set_postal(string  $str) 

Set the postal/zip code for this address.

Parameters

string $str

get_postal()

get_postal() : string

Return the postal/zip code (if any) associated with this address.

Returns

string

set_country()

set_country(string  $str) 

Set the country for this address.

it is recommended to use the short country code (i.e: US or CA) for most addresses.

Parameters

string $str

get_country()

get_country() : string

Return the country (if any) associated with this address.

Returns

string

set_phone()

set_phone(string  $str) 

Set a phone number for this address.

Parameters

string $str

get_phone()

get_phone() : string

Return the phone number (if any) associated with this address.

Returns

string

set_fax()

set_fax(string  $str) 

Set a fax number for this address.

Parameters

string $str

get_fax()

get_fax() : string

Return the fax number (if any) associated with this address.

Returns

string

set_email()

set_email(string  $str) 

Set an email address for this address.

Parameters

string $str

get_email()

get_email() : string

Return the email address (if any) associated with this address.

Returns

string

is_valid()

is_valid() : boolean

Test if the address is valid or not.

Returns

boolean

from_array()

from_array(array  $params, string  $prefix = '') 

Fill the contents of the current object with the data from an array.

Expects an associative array with the following fields: company,firstname,lastname,address1,address2,city,state,postal,country,phone,fax,email.

Parameters

array $params

The input array

string $prefix

An optional prefix for the array keys.

to_array()

to_array(string  $prefix = '') : array

Create an associative array with the details oft he address.

Parameters

string $prefix

An optional prefix for each of the array keys.

Returns

array