Documentation

ParsedDataExtractor

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
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Constants

MAX_DEPTH  : mixed = 10

Methods

extract()  : array<string|int, mixed>
normalize()  : mixed
readGetters()  : array<string|int, mixed>

Constants

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
Return values
array<string|int, mixed>
On this page

Search results