Overview

Namespaces

  • BeerXML
    • Exception
    • Generator
    • Parser
    • Record
  • PHP

Classes

  • Equipment
  • Fermentable
  • Hop
  • MashProfile
  • MashStep
  • Misc
  • Recipe
  • Record
  • RecordFactory
  • Style
  • Water
  • Yeast

Interfaces

  • IEquipment
  • IEquipmentDisplay
  • IFermentable
  • IFermentableDisplay
  • IHop
  • IHopDisplay
  • IMashProfile
  • IMashProfileDisplay
  • IMashStep
  • IMashStepDisplay
  • IMisc
  • IMiscDisplay
  • IRecipe
  • IRecipeDisplay
  • IStyle
  • IStyleDisplay
  • IWater
  • IWaterDisplay
  • IYeast
  • IYeastDisplay
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: 
 4: namespace BeerXML\Parser;
 5: 
 6: class MashProfile extends Record
 7: {
 8:     protected $tagName = 'MASH';
 9: 
10:     /**
11:      * Tags that map to simple values and the corresponding setter method on the record class
12:      *
13:      * @var array
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:      * @return IMashProfile
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:      * @param IMashProfile $record
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: 
php-beerxml API documentation generated by ApiGen 2.8.0