EntityAffiliation()
EntityAffiliation(string $theType, mixed $theValue, boolean $getOld) : mixed
Manage affiliation
This method can be used to add, retrieve and delete individual affiliations by type, while managing all the mails as a whole can be done using the {@link kTAG_ENTITY_AFFILIATION} offset.
The method expects the following parameters:
- $theType: This parameter holds the type of the affiliation we want to manage. If NULL, it means that there is an affiliation without a type; this can occur if the it is the default one.
- $theValue: This parameter holds the affiliated entity reference or
operation:
- NULL: Return the affiliation of the provided type.
- FALSE: Delete the affiliation of the provided type.
- other: Any other value is cast to string and interpreted as the entity reference 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.
When providing a new affiliation, the method will call the {@link validateReference()} method to validate the reference.
The method will return either the affiliation, or NULL if the type was not matched.
Parameters
string | $theType | Affiliation type. |
mixed | $theValue | Affiliation or operation. |
boolean | $getOld | TRUE get old value. |
Returns
mixed —Old or new value.