\OntologyWrapper\traitsLabel

Label trait

This trait implements a method for managing the label offset, {@link kTAG_LABEL}. The method manages the individual labels by language.

Summary

Methods
Properties
Constants
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

Label()

Label(string $theLanguage, mixed $theValue, boolean $getOld) : mixed

Manage tag label

This method can be used to add, retrieve and delete individual labels by language, while managing all the labels as a whole can be done using the {@link kTAG_LABEL} offset.

The method expects the following parameters:

  • $theLanguage: This parameter holds the language code of the text we want to manage. If NULL, it means that there is a text without a language; this can occur if the label is a name unrelated to any language.
  • $theValue: This parameter identifies the label text or operation:
    • NULL: Return the label of the provided language.
    • FALSE: Delete the label of the provided language.
    • other: Any other value is cast to string and interpreted as the text of the label in the provided language 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 label text, or NULL if the language was not matched.

Parameters

string $theLanguage

Label language.

mixed $theValue

Label text or operation.

boolean $getOld

TRUE get old value.

Returns

mixed —

Old or new value.