1: <?php
2:
3:
4: namespace BeerXML\Parser;
5:
6:
7: /**
8: * Factory for record classes. \BeerXML\Parser uses this (or a subclass of this) to create objects to store the data it
9: * finds.
10: *
11: * If you want \BeerXML\Parser to write into different classes, implement the Writer interfaces in this directory in
12: * your objects, subclass this Factory class so that it returns the objects you want, and then pass it into
13: * \BeerXML\Parser
14: *
15: * @package BeerXML\Parser
16: */
17: class RecordFactory {
18:
19: /**
20: * @return IEquipment
21: */
22: public function getEquipment()
23: {
24: return new \BeerXML\Record\Equipment();
25: }
26:
27: /**
28: * @return IFermentable
29: */
30: public function getFermentable()
31: {
32: return new \BeerXML\Record\Fermentable();
33: }
34:
35: /**
36: * @return IHop
37: */
38: public function getHop()
39: {
40: return new \BeerXML\Record\Hop();
41: }
42:
43: /**
44: * @return IMashProfile
45: */
46: public function getMashProfile()
47: {
48: return new \BeerXML\Record\MashProfile();
49: }
50:
51: /**
52: * @return IMashStep
53: */
54: public function getMashStep()
55: {
56: return new \BeerXML\Record\MashStep();
57: }
58:
59: /**
60: * @return IMisc
61: */
62: public function getMisc()
63: {
64: return new \BeerXML\Record\Misc();
65: }
66:
67: /**
68: * @return IRecipe
69: */
70: public function getRecipe()
71: {
72: return new \BeerXML\Record\Recipe();
73: }
74:
75: /**
76: * @return IStyle
77: */
78: public function getStyle()
79: {
80: return new \BeerXML\Record\Style();
81: }
82:
83: /**
84: * @return IWater
85: */
86: public function getWater()
87: {
88: return new \BeerXML\Record\Water();
89: }
90:
91: /**
92: * @return IYeast
93: */
94: public function getYeast()
95: {
96: return new \BeerXML\Record\Yeast();
97: }
98: }
99: