\CGContactscontact_phone

A phone number has a type, as well as a label and value.

The type is based on VCARD 3.0 specifications.

Summary

Methods
Properties
Constants
__construct()
get_type()
set_type()
get_value()
set_value()
validate()
get_raw_value()
to_data()
set_data()
get_contact_id()
get_class()
get_label()
set_label()
is_preferred()
set_preferred()
allows_multiple()
No public properties found
TYPE_VOICE
TYPE_MSG
TYPE_FAX
TYPE_MOBILE
TYPE_PAGER
TYPE_VIDEO
TYPE_SAT
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_VOICE

TYPE_VOICE

TYPE_MSG

TYPE_MSG

TYPE_FAX

TYPE_FAX

TYPE_MOBILE

TYPE_MOBILE

TYPE_PAGER

TYPE_PAGER

TYPE_VIDEO

TYPE_VIDEO

TYPE_SAT

TYPE_SAT

Methods

__construct()

__construct(\CGContacts\contact $parent)

Constructor

Parameters

\CGContacts\contact $parent

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

get_type()

get_type() : string

Get the type of this phone object.

Returns

string

set_type()

set_type(string $val)

Set the type of this phone object.

Parameters

string $val

get_value()

get_value() : string

Get the value (phone number) for this object.

Returns

string

set_value()

set_value(string $val)

Set the value (phone number) for this object.

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

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

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