\OntologyWrapper\traitsEntityPhone

Entity telephone trait

This trait implements a method for managing the entity telephone number offset, {@link kTAG_ENTITY_PHONE}. The method manages the individual telephone numbers by type.

Summary

Methods
Properties
Constants
EntityPhone()
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

EntityPhone()

EntityPhone(string $theType, mixed $theValue, boolean $getOld) : mixed

Manage telephone number

This method can be used to add, retrieve and delete individual telephone numbers by type, while managing all the telephones as a whole can be done using the {@link kTAG_ENTITY_PHONE} offset.

The method expects the following parameters:

  • $theType: This parameter holds the type of the telephone number we want to manage. If NULL, it means that there is a phone without a type; this can occur if the telephone is the default one.
  • $theValue: This parameter identifies the telephone number or operation:
    • NULL: Return the phone of the provided type.
    • FALSE: Delete the phone of the provided type.
    • other: Any other value is cast to string and interpreted as the telephone number of provided type which will be inserted, or that will replace an existing entry.
  • $getOld: Determines what the method will return:
    • TRUE: Return the value before it was eventually modified.
    • FALSE: Return the value after it was eventually modified.

The method will return either the phone number, or NULL if the type was not matched.

Parameters

string $theType

Telephone number type.

mixed $theValue

Telephone number or operation.

boolean $getOld

TRUE get old value.

Returns

mixed —

Old or new value.