\CGContactscontact_address

This class defines a physical address.

Multiple physical addresses can be associated with a contact.

Summary

Methods
Properties
Constants
format()
get_street()
set_street()
get_pobox()
set_pobox()
get_city()
set_city()
get_zip()
set_zip()
get_state()
set_state()
get_country()
set_country()
validate()
get_raw_value()
__construct()
get_contact_id()
get_class()
get_label()
set_label()
is_preferred()
set_preferred()
allows_multiple()
to_data()
set_data()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

format()

format() : string

Format the address as a single string.

Returns

string

get_street()

get_street() : string

Get the street address portion of the address.

Returns

string

set_street()

set_street(string $val)

Set the string address portion of the address.

Parameters

string $val

get_pobox()

get_pobox() : string

Get the post office box portion of the address.

Returns

string

set_pobox()

set_pobox(string $val)

Set the post office box portion of the address.

Parameters

string $val

get_city()

get_city() : string

Get the city portion of the address.

Returns

string

set_city()

set_city(string $val)

Set the city portion of the address.

Parameters

string $val

get_zip()

get_zip() : string

Get the zip/postal code portion of the address.

Returns

string

set_zip()

set_zip(string $val)

Set the zip/postal code portion of the address.

Parameters

string $val

get_state()

get_state() : string

Get the state/province code portion of the address.

Returns

string

set_state()

set_state(string $val)

Set the state/province portion of the address.

Parameters

string $val

get_country()

get_country() : string

Get the country portion of the address.

Returns

string

set_country()

set_country(string $val)

Set the country portion of the address.

Parameters

string $val

validate()

validate()

Validate the contents of the object. Throw an exception if an error is encountered.

get_raw_value()

get_raw_value() : string

Get the raw value (for storing in the database) of this object.

Returns

string

__construct()

__construct(\CGContacts\contact $parent)

Constructor

Parameters

\CGContacts\contact $parent

A reference to the contact object that will own this object.

get_contact_id()

get_contact_id() : int

Return the id of the parent contact object.

If the contact object is new and has not been saved, it may not have an id.

Returns

int

get_class()

get_class() : string

Get the class (type) of this object.

Returns

string

get_label()

get_label() : string

Get the label, if any, associated with this object.

Returns

string

set_label()

set_label(string $label)

Set a label for this object.

Parameters

string $label

is_preferred()

is_preferred() : bool

Test if this object is a preferred object of its type for this contact.

Returns

bool

set_preferred()

set_preferred(mixed $flag)

Set the preferred flag for this object.

This method will attempt to interpret the passed value as a boolean in any way it can.

Parameters

mixed $flag

allows_multiple()

allows_multiple() : bool

Whether there can be multiple objects of this type associated with a contact.

Returns

bool

to_data()

to_data() : array

Convert this object to a data array.

Returns

array

set_data()

set_data(array $data)

Fill this object from a data array.

Parameters

array $data