1: <?php
2:
3:
4: namespace BeerXML\Parser;
5:
6: class MashProfile extends Record
7: {
8: protected $tagName = 'MASH';
9:
10: 11: 12: 13: 14:
15: protected $simpleProperties = array(
16: 'NAME' => 'setName',
17: 'VERSION' => 'setVersion',
18: 'GRAIN_TEMP' => 'setGrainTemp',
19: 'NOTES' => 'setNotes',
20: 'TUN_TEMP' => 'setTunTemp',
21: 'SPARGE_TEMP' => 'setSpargeTemp',
22: 'PH' => 'setPH',
23: 'TUN_WEIGHT' => 'setTunWeight',
24: 'TUN_SPECIFIC_HEAT' => 'setTunSpecificHeat',
25: );
26:
27: 28: 29:
30: protected function createRecord()
31: {
32: $mashProfile = $this->recordFactory->getMashProfile();
33: if ($mashProfile instanceof IMashProfileDisplay) {
34: $this->simpleProperties = array_merge(
35: $this->simpleProperties,
36: array(
37: 'DISPLAY_GRAIN_TEMP' => 'setDisplayGrainTemp',
38: 'DISPLAY_TUN_TEMP' => 'setDisplayTunTemp',
39: 'DISPLAY_SPARGE_TEMP' => 'setDisplaySpargeTemp',
40: 'DISPLAY_TUN_WEIGHT' => 'setDisplayTunWeight',
41: )
42: );
43: }
44: return $mashProfile;
45: }
46:
47: 48: 49:
50: protected function otherElementEncountered($record)
51: {
52: if ('EQUIP_ADJUST' == $this->xmlReader->name) {
53: $value = ($this->xmlReader->readString() == 'TRUE');
54: $record->setEquipAdjust($value);
55: }
56: }
57: }
58: