\CGContactscontact_score01

A simple class to allow storing a daily wage (a number) with a contact.

A contact can consist of multiple objects of different types.

Summary

Methods
Properties
Constants
validate()
__construct()
get_value()
is_preferred()
set_preferred()
allows_multiple()
set_value()
get_raw_value()
to_data()
set_data()
get_contact_id()
get_class()
get_label()
set_label()
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

validate()

validate()

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

__construct()

__construct(\CGContacts\contact $parent)

Constructor

Parameters

\CGContacts\contact $parent

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

get_value()

get_value() : string

Get the value stored in the object.

Returns

string

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

set_value()

set_value(string $val)

Set the value associated with this object.

Parameters

string $val

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