$mIterator
$mIterator : \OntologyWrapper\ObjectIterator
Iterator.
This protected data member holds the iterator.
Iterator serialiser
The duty of this class is to serialise query data returned by the services into a formatted set of data. The goal is to serialise the paged results into a single structure tagged by the API, providing a resolved set of data suited to be handled by user interface clients.
The class manages five main elements:
When requesting the {@link kAPI_RESULT_ENUM_DATA_COLUMN} or the {@link kAPI_RESULT_ENUM_DATA_FORMAT} format, the results will be encoded as an array indexed by object native identifier, containing the object data encoded as follows:
Once serialised, the iterator data is available via the {@link paging()}, {@link dictionary()} and {@link data()} methods which return respectively the paging, the dictionary and the serialised data.
$mIterator : \OntologyWrapper\ObjectIterator
Iterator.
This protected data member holds the iterator.
$mOffset : string
Offsets tag.
This protected data member holds the offsets tag to be tracked, this is relevant when serialising tags, the value corresponds to the tag offset which records the offsets found in a particular collection, these are the valid values:
$mCurrentUnit : \OntologyWrapper\PersistentObject
Current unit.
This protected data member holds the current unit object.
__construct(\OntologyWrapper\ObjectIterator $theIterator, string $theFormat, string $theLanguage, string $theDomain, string $theShape)
Instantiate class.
The constructor accepts all required object properties, the iterator, format and language are required, the other parameters may be set via the member accessor methods and are required depending on the type of format.
The iterator should have been paged by the caller: in this class we do not handle paging and sorting, we simply scan the iterator.
\OntologyWrapper\ObjectIterator | $theIterator | Iterator. |
string | $theFormat | Data format. |
string | $theLanguage | Default language. |
string | $theDomain | Optional domain for columns. |
string | $theShape | Optional shape for markers. |
iterator(\OntologyWrapper\ObjectIterator $theIterator, boolean $getOld) : \OntologyWrapper\ObjectIterator
Manage iterator
This method can be used to set the iterator, each time the iterator is set, the {@link paging()} information will be updated.
If the provided parameter is not an iterator, the method will return the current iterator.
Whenever the iterator is modified, the method will reset the processed flag, the paging information and the serialised data.
The method does not allow resetting the iterator.
\OntologyWrapper\ObjectIterator | $theIterator | Iterator. |
boolean | $getOld | TRUE get old value. |
Current or previous iterator.
format(string $theFormat, boolean $getOld) : string
Manage format
This method can be used to set the format, the method will check if the provided value is correct.
Provide NULL to retrieve the current format.
Whenever the format is modified, the method will reset the processed flag, the paging information and the serialised data.
The method does not allow resetting the format.
string | $theFormat | Format. |
boolean | $getOld | TRUE get old value. |
Current or previous format.
domain(string $theDomain, boolean $getOld) : array
Manage domain
This method can be used to set the domain, the method will cache the provided domain and set the data member as a reference to the cached array object.
Provide NULL to retrieve the current domain.
Whenever the domain is modified, the method will reset the processed flag, the paging information and the serialised data.
The method does not allow resetting the domain.
string | $theDomain | Domain. |
boolean | $getOld | TRUE get old value. |
Current or previous domain array object.
shape(string $theShape, boolean $getOld) : array
Manage shape
This method can be used to set the shape, the method will cache the provided shape and set the data member as a reference to the cached array object.
Provide NULL to retrieve the current shape.
Whenever the shape is modified, the method will reset the processed flag, the paging information and the serialised data.
The method does not allow resetting the shape.
string | $theShape | Shape. |
boolean | $getOld | TRUE get old value. |
Current or previous shape array object.
language(string $theLanguage, boolean $getOld) : array
Manage language
This method can be used to set the language, the method will set the language data member to the provided value.
Provide NULL to retrieve the current language.
The method does not allow resetting the language.
string | $theLanguage | Language. |
boolean | $getOld | TRUE get old value. |
Current or previous language.
setColumns()
Set table columns
The duty of this method is to set the table column information according to the current domain.
The method will format the columns in two ways, depending on the data format:
This method expects the domain parameter to have been set.
setProperty(array $theContainer, string $theOffset, mixed $theValue)
Set property
The duty of this method is to cache the property tag, allocate the property in the provided container, set the property labels and format the property value.
array | $theContainer | Data container. |
string | $theOffset | Data offset. |
mixed | $theValue | Data value. |
setDataValue(array $theContainer, mixed $theValue, array $theTag)
Set value
The duty of this method is to set the provided container with the provided data value.
This method expects the current offset tag to have been cached.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Tag array object. |
aggregateProperty(string $theClass, string $theOffset, mixed $theValue, boolean $doTags)
Aggregate property
The duty of this method is to aggregate the provided offset tag and parse the eventual structured value.
string | $theClass | Object class. |
string | $theOffset | Data offset. |
mixed | $theValue | Data value. |
boolean | $doTags | TRUE means recurse tags. |
formatDataValue(array $theContainer, mixed $theValue, array $theTag)
Format value
The duty of this method is to format and set the provided container with the provided data value.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Tag array object. |
formatEnumeration(array $theContainer, mixed $theValue, array $theTag)
Format enumerated value
The duty of this method is to format the provided enumerated value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatTypedList(array $theContainer, mixed $theValue, array $theTag)
Format typed list value
The duty of this method is to format the provided typed list value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatLanguageStrings(array $theContainer, mixed $theValue, array $theTag)
Format language strings value
The duty of this method is to format the provided language strings and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatUnitReference(array $theContainer, mixed $theValue, array $theTag)
Format unit reference value
The duty of this method is to format the provided unit reference and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatBoolean(array $theContainer, mixed $theValue, array $theTag)
Format boolean value
The duty of this method is to format the provided boolean value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatInteger(array $theContainer, mixed $theValue, array $theTag)
Format integer value
The duty of this method is to format the provided integer value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatTimeStamp(array $theContainer, mixed $theValue, array $theTag)
Format time stamp value
The duty of this method is to format the provided time stamp value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
formatScalar(array $theContainer, mixed $theValue, array $theTag)
Format scalar value
The duty of this method is to format the provided scalar value and set into the provided container.
array | $theContainer | Data container. |
mixed | $theValue | Data value. |
array | $theTag | Offset tag. |
cacheTag(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue, boolean $doSequence) : mixed
Load tag in cache
This method will load the provided tag into the provided container, if not yet there, and return the cached tag as an array object.
The provided parameter may be an array, in that case the method will interpret the parameter as a list of references, add all the resolved objects to the provided container and return an array indexed by object identifier, with as value the object array.
If the last parameter is TRUE, the tag identifier will be its sequence number; if FALSE, its native identifier.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | Tag reference or object. |
boolean | $doSequence | TRUE, use sequence as identifier. |
The cached tag or tags.
cacheTerm(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue) : mixed
Load term in cache
This method will load the provided term into the provided container, if not yet there, and return the cached term as an array object.
The provided parameter may be an array, in that case the method will interpret the parameter as a list of references, add all the resolved objects to the provided container and return an array indexed by object identifier, with as value the object array.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | Term reference or object. |
The cached term or terms.
cacheNode(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue) : mixed
Load node in cache
This method will load the provided node into the provided container, if not yet there, and return the node object as an array.
The provided parameter may be an array, in that case the method will add all the provided nodes and return an array of node array objects indexed by node native identifier.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | Node reference or object. |
The cached node or nodes.
cacheEdge(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue) : mixed
Load edge in cache
This method will load the provided edge into the provided container, if not yet there, and return the edge object as an array.
The provided parameter may be an array, in that case the method will add all the provided edges and return an array of edge array objects indexed by edge native identifier.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | Edge reference or object. |
The cached edge or edges.
cacheUnit(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue, boolean $doObject) : mixed
Load unit in cache
This method will load the provided unit into the provided container, if not yet there, and return the unit object as an array.
The provided parameter may be an array, in that case the method will add all the provided units and return an array of unit objects indexed by unit native identifier.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | Unit reference or object. |
boolean | $doObject | TRUE means cache object. |
The cached unit or units.
cacheUser(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, mixed $theValue, boolean $doObject) : mixed
Load user in cache
This method will load the provided user into the provided container, if not yet there, and return the user object as an array.
The provided parameter may be an array, in that case the method will add all the provided users and return an array of user array objects indexed by term native identifier.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
mixed | $theValue | User reference or object. |
boolean | $doObject | TRUE means cache object. |
The cached user or users.
cacheObject(\OntologyWrapper\Wrapper $theWrapper, array $theContainer, string $theClass, array $theStrings, mixed $theValue, boolean $doObject) : mixed
Load object in cache
This method will load the provided node into the provided container, if not yet there, and return the cached node as an object or array object.
The provided parameter may be an array, in that case the method will interpret the parameter as a list of references, add all the resolved objects to the provided container and return an array indexed by object identifier, with as value the object or array object.
\OntologyWrapper\Wrapper | $theWrapper | Data wrapper. |
array | $theContainer | Data container. |
string | $theClass | Object class name. |
array | $theStrings | Language string offsets. |
mixed | $theValue | Object reference or object. |
boolean | $doObject | TRUE means cache object. |
The cached object or objects.
setHiddenTags(\OntologyWrapper\PersistentObject $theObject)
Set hidden tags
The duty of this method is to set the list of tags that should not be published.
This is done according to the current data format, only the {@link kAPI_RESULT_ENUM_DATA_FORMAT} is relevant in this case, since the {@link kAPI_RESULT_ENUM_DATA_COLUMN} has a fixed set, the {@link kAPI_RESULT_ENUM_DATA_MARKER} uses only the object native identifier and the shape tag, and the {@link kAPI_RESULT_ENUM_DATA_RECORD} format selects all properties.
Once the method has completed, the {@link $mHidden} data member will hold the list of tag sequence numbers which will not be published.
By default we hide the object's internal and dynamic offsets.
\OntologyWrapper\PersistentObject | $theObject | Object. |
CollectOffsetTags(array $theContainer, \OntologyWrapper\PersistentObject $theTag)
Collect offset tags
This method will collect the offset tag objects of the provided tag into the provided container.
array | $theContainer | Receives tag objects. |
\OntologyWrapper\PersistentObject | $theTag | Tag object or array object. |