ParsedDataExtractor
in package
AbstractYes
Class ParsedDataExtractor The parsers share no common set of fields, but each exposes what it read through public getters.
Reading those getters is what lets every parser, including one added later, be stored without any code of its own : getBaseRange() becomes "baseRange", isTruePositive() becomes "truePositive", and an object found on the way (a reference, an atom...) is read the same way, recursively.
Tags
Table of Contents
Constants
- MAX_DEPTH : mixed = 10
Methods
- extract() : array<string|int, mixed>
- normalize() : mixed
- readGetters() : array<string|int, mixed>
Constants
MAX_DEPTH
private
mixed
MAX_DEPTH
= 10
Methods
extract()
public
static extract(object $oSource) : array<string|int, mixed>
Parameters
- $oSource : object
-
A parser, once it has read a record
Return values
array<string|int, mixed> —The fields it exposes, ready to be encoded as JSON
normalize()
private
static normalize(mixed $mValue, array<string|int, mixed> $aPath, int $iDepth) : mixed
Parameters
- $mValue : mixed
- $aPath : array<string|int, mixed>
- $iDepth : int
readGetters()
private
static readGetters(object $oSource, array<string|int, mixed> $aPath, int $iDepth) : array<string|int, mixed>
Parameters
- $oSource : object
- $aPath : array<string|int, mixed>
-
Objects being read, to stop on a reference to itself
- $iDepth : int