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: 
 7: class Equipment extends Record
 8: {
 9:     protected $tagName = 'EQUIPMENT';
10: 
11:     /**
12:      * Tags that map to simple values and the corresponding setter method on the record class
13:      *
14:      * @var array
15:      */
16:     protected $simpleProperties = array(
17:         'NAME'              => 'setName',
18:         'VERSION'           => 'setVersion',
19:         'BOIL_SIZE'         => 'setBoilSize',
20:         'BATCH_SIZE'        => 'setBatchSize',
21:         'TUN_VOLUME'        => 'setTunVolume',
22:         'TUN_WEIGHT'        => 'setTunWeight',
23:         'TUN_SPECIFIC_HEAT' => 'setTunSpecificHeat',
24:         'TOP_UP_WATER'      => 'setTopUpWater',
25:         'TRUB_CHILLER_LOSS' => 'setTrubChillerLoss',
26:         'EVAP_RATE'         => 'setEvapRate',
27:         'BOIL_TIME'         => 'setBoilTime',
28:         'LAUTER_DEADSPACE'  => 'setLauterDeadspace',
29:         'TOP_UP_KETTLE'     => 'setTopUpKettle',
30:         'HOP_UTILIZATION'   => 'setHopUtilization',
31:         'NOTES'             => 'setNotes',
32:     );
33: 
34:     /**
35:      * @return IEquipment
36:      */
37:     protected function createRecord()
38:     {
39:         $equipment = $this->recordFactory->getEquipment();
40:         if ($equipment instanceof IEquipmentDisplay) {
41:             $this->simpleProperties = array_merge(
42:                 $this->simpleProperties,
43:                 array(
44:                     'DISPLAY_BOIL_SIZE'         => 'setDisplayBoilSize',
45:                     'DISPLAY_BATCH_SIZE'        => 'setDisplayBatchSize',
46:                     'DISPLAY_TUN_VOLUME'        => 'setDisplayTunVolume',
47:                     'DISPLAY_TUN_WEIGHT'        => 'setDisplayTunWeight',
48:                     'DISPLAY_TOP_UP_WATER'      => 'setDisplayTopUpWater',
49:                     'DISPLAY_TRUB_CHILLER_LOSS' => 'setDisplayTrubChillerLoss',
50:                     'DISPLAY_LAUTER_DEADSPACE'  => 'setDisplayLauterDeadspace',
51:                     'DISPLAY_TOP_UP_KETTLE'     => 'setDisplayTopUpKettle',
52:                 )
53:             );
54:         }
55:         return $equipment;
56:     }
57: 
58:     /**
59:      * @param IEquipment $record
60:      */
61:     protected function otherElementEncountered($record)
62:     {
63:         if ('CALC_BOIL_VOLUME' == $this->xmlReader->name) {
64:             $value = ($this->xmlReader->readString() == 'TRUE');
65:             $record->setCalcBoilVolume($value);
66:         }
67:     }
68: }
69: 
php-beerxml API documentation generated by ApiGen 2.8.0