Class Record
Abstract Record Parser
This sets the stage for all of our parsers. Each subclass can define a map of tags to setter methods. The parser will then call the setter methods with the values from those tags.
Direct known subclasses
BeerXML\Parser\Equipment, BeerXML\Parser\Fermentable, BeerXML\Parser\Hop, BeerXML\Parser\MashProfile, BeerXML\Parser\MashStep, BeerXML\Parser\Misc, BeerXML\Parser\Recipe, BeerXML\Parser\Style, BeerXML\Parser\Water, BeerXML\Parser\Yeast
public
|
|
public
|
|
public
|
|
public
mixed
|
|
abstract protected
|
|
protected
|
#
otherElementEncountered(
Called when an unknown element is encountered, useful for edge cases |
protected
|
|
protected
|
|
protected
|
protected
string
|
$tagName | null |
#
The <TAG> that a subclass parses |
protected
|
$xmlReader |
|
|
protected
|
$recordFactory |
|
|
protected
array
|
$simpleProperties | array() |
#
Tags that map to simple values and the corresponding setter method on the record class |
protected
array
|
$complexProperties | array(
'STYLE' => array(
'parser' => '\BeerXML\Parser\Style',
'method' => 'setStyle'
),
'EQUIPMENT' => array(
'parser' => '\BeerXML\Parser\Equipment',
'method' => 'setEquipment'
),
'MASH' => array(
'parser' => '\BeerXML\Parser\MashProfile',
'method' => 'setMash'
),
) |
|
protected
array
|
$complexPropertySets | array(
'HOPS' => array(
'tag' => 'HOP',
'parser' => '\BeerXML\Parser\Hop',
'method' => 'addHop'
),
'FERMENTABLES' => array(
'tag' => 'FERMENTABLE',
'parser' => '\BeerXML\Parser\Fermentable',
'method' => 'addFermentable',
),
'MISCS' => array(
'tag' => 'MISC',
'parser' => '\BeerXML\Parser\Misc',
'method' => 'addMisc',
),
'WATERS' => array(
'tag' => 'WATER',
'parser' => '\BeerXML\Parser\Water',
'method' => 'addWater',
),
'YEASTS' => array(
'tag' => 'YEAST',
'parser' => '\BeerXML\Parser\Yeast',
'method' => 'addYeast',
),
'MASH_STEPS' => array(
'tag' => 'MASH_STEP',
'parser' => '\BeerXML\Parser\MashStep',
'method' => 'addMashStep',
),
'STYLES' => array(
'tag' => 'STYLE',
'parser' => '\BeerXML\Parser\Style',
'method' => 'addSTyle'
),
'EQUIPMENTS' => array(
'tag' => 'EQUIPMENT',
'parser' => '\BeerXML\Parser\Equipment',
'method' => 'addEquipment'
),
'MASHS' => array(
'tag' => 'MASH',
'parser' => '\BeerXML\Parser\MashProfile',
'method' => 'addMash'
),
) |