1: <?php
2:
3:
4: namespace BeerXML\Record;
5:
6:
7: use BeerXML\Generator\IMiscDisplay as MiscGetter;
8: use BeerXML\Parser\IMiscDisplay as MiscSetter;
9:
10: class Misc implements MiscGetter, MiscSetter
11: {
12: const TYPE_SPICE = 'Spice';
13: const TYPE_FINING = 'Fining';
14: const TYPE_WATER_AGENT = 'Water Agent';
15: const TYPE_HERB = 'Herb';
16: const TYPE_FLAVOR = 'Flavor';
17: const TYPE_OTHER = 'Other';
18: const USE_BOIL = 'Boil';
19: const USE_MASH = 'Mash';
20: const USE_PRIMARY = 'Primary';
21: const USE_SECONDARY = 'Secondary';
22: const USE_BOTTLING = 'Bottling';
23:
24: /**
25: * Name of the misc item.
26: *
27: * @var string
28: */
29: private $name;
30:
31: /**
32: * Version number of this element. Should be "1" for this version.
33: *
34: * @var int
35: */
36: private $version = 1;
37:
38: /**
39: * May be "Spice", "Fining", "Water Agent", "Herb", "Flavor" or "Other"
40: *
41: * @var string
42: */
43: private $type;
44:
45: /**
46: * May be "Boil", "Mash", "Primary", "Secondary", "Bottling"
47: *
48: * @var string
49: */
50: private $use;
51:
52: /**
53: * Amount of time the misc was boiled, steeped, mashed, etc in minutes
54: *
55: * @var number
56: */
57: private $time;
58:
59: /**
60: * Amount of item used. The default measurements are by weight, but this may be the measurement in volume units if
61: * AMOUNT_IS_WEIGHT is set to TRUE for this record. If a liquid it is in liters, if a solid the weight is measured
62: * in kilograms.
63: *
64: * @var number
65: */
66: private $amount;
67:
68: /**
69: * TRUE if the amount measurement is a weight measurement and FALSE if the amount is a volume measurement. Default
70: * value (if not present) is assumed to be FALSE.
71: *
72: * @var bool
73: */
74: private $amountIsWeight = false;
75:
76: /**
77: * Short description of what the ingredient is used for in text
78: *
79: * @var string
80: */
81: private $useFor;
82:
83: /**
84: * Detailed notes on the item including usage. May be multiline.
85: *
86: * @var string
87: */
88: private $notes;
89:
90: /** Fields from Appendix A Optional Extensions for BeerXML Display **/
91:
92: /**
93: * @var string
94: */
95: private $displayAmount;
96:
97: /**
98: * @var string
99: */
100: private $inventory;
101:
102: /**
103: * @var string
104: */
105: private $displayTime;
106:
107: /**
108: * Amount of item used. The default measurements are by weight, but this may be the measurement in volume units if
109: * AMOUNT_IS_WEIGHT is set to TRUE for this record. If a liquid it is in liters, if a solid the weight is measured
110: * in kilograms.
111: *
112: * @param number $amount
113: */
114: public function setAmount($amount)
115: {
116: $this->amount = $amount;
117: }
118:
119: /**
120: * Amount of item used. The default measurements are by weight, but this may be the measurement in volume units if
121: * AMOUNT_IS_WEIGHT is set to TRUE for this record. If a liquid it is in liters, if a solid the weight is measured
122: * in kilograms.
123: *
124: * @return number
125: */
126: public function getAmount()
127: {
128: return $this->amount;
129: }
130:
131: /**
132: * TRUE if the amount measurement is a weight measurement and FALSE if the amount is a volume measurement. Default
133: * value (if not present) is assumed to be FALSE.
134: *
135: * @param boolean $amountIsWeight
136: */
137: public function setAmountIsWeight($amountIsWeight)
138: {
139: $this->amountIsWeight = $amountIsWeight;
140: }
141:
142: /**
143: * TRUE if the amount measurement is a weight measurement and FALSE if the amount is a volume measurement. Default
144: * value (if not present) is assumed to be FALSE.
145: *
146: * @return boolean
147: */
148: public function getAmountIsWeight()
149: {
150: return $this->amountIsWeight;
151: }
152:
153: /**
154: * Name of the misc item.
155: *
156: * @param string $name
157: */
158: public function setName($name)
159: {
160: $this->name = $name;
161: }
162:
163: /**
164: * Name of the misc item.
165: *
166: * @return string
167: */
168: public function getName()
169: {
170: return $this->name;
171: }
172:
173: /**
174: * Detailed notes on the item including usage. May be multiline.
175: *
176: * @param string $notes
177: */
178: public function setNotes($notes)
179: {
180: $this->notes = $notes;
181: }
182:
183: /**
184: * Detailed notes on the item including usage. May be multiline.
185: *
186: * @return string
187: */
188: public function getNotes()
189: {
190: return $this->notes;
191: }
192:
193: /**
194: * Amount of time the misc was boiled, steeped, mashed, etc in minutes
195: *
196: * @param number $time
197: */
198: public function setTime($time)
199: {
200: $this->time = $time;
201: }
202:
203: /**
204: * Amount of time the misc was boiled, steeped, mashed, etc in minutes
205: *
206: * @return number
207: */
208: public function getTime()
209: {
210: return $this->time;
211: }
212:
213: /**
214: * May be "Spice", "Fining", "Water Agent", "Herb", "Flavor" or "Other"
215: *
216: * @param string $type
217: */
218: public function setType($type)
219: {
220: $this->type = $type;
221: }
222:
223: /**
224: * May be "Spice", "Fining", "Water Agent", "Herb", "Flavor" or "Other"
225: *
226: * @return string
227: */
228: public function getType()
229: {
230: return $this->type;
231: }
232:
233: /**
234: * May be "Boil", "Mash", "Primary", "Secondary", "Bottling"
235: *
236: * @param string $use
237: */
238: public function setUse($use)
239: {
240: $this->use = $use;
241: }
242:
243: /**
244: * May be "Boil", "Mash", "Primary", "Secondary", "Bottling"
245: *
246: * @return string
247: */
248: public function getUse()
249: {
250: return $this->use;
251: }
252:
253: /**
254: * Short description of what the ingredient is used for in text
255: *
256: * @param string $useFor
257: */
258: public function setUseFor($useFor)
259: {
260: $this->useFor = $useFor;
261: }
262:
263: /**
264: * Short description of what the ingredient is used for in text
265: *
266: * @return string
267: */
268: public function getUseFor()
269: {
270: return $this->useFor;
271: }
272:
273: /**
274: * Version number of this element. Should be "1" for this version.
275: *
276: * @param int $version
277: */
278: public function setVersion($version)
279: {
280: $this->version = $version;
281: }
282:
283: /**
284: * Version number of this element. Should be "1" for this version.
285: *
286: * @return int
287: */
288: public function getVersion()
289: {
290: return $this->version;
291: }
292:
293: /**
294: * The amount of the item in this record along with the units formatted for easy display in the current user defined
295: * units. For example "1.5 lbs" or "2.1 kg".
296: *
297: * @param string $displayAmount
298: */
299: public function setDisplayAmount($displayAmount)
300: {
301: $this->displayAmount = $displayAmount;
302: }
303:
304: /**
305: * The amount of the item in this record along with the units formatted for easy display in the current user defined
306: * units. For example "1.5 lbs" or "2.1 kg".
307: *
308: * @return string
309: */
310: public function getDisplayAmount()
311: {
312: return $this->displayAmount;
313: }
314:
315: /**
316: * Time in appropriate units along with the units as in "10 min" or "3 days".
317: *
318: * @param string $displayTime
319: */
320: public function setDisplayTime($displayTime)
321: {
322: $this->displayTime = $displayTime;
323: }
324:
325: /**
326: * Time in appropriate units along with the units as in "10 min" or "3 days".
327: *
328: * @return string
329: */
330: public function getDisplayTime()
331: {
332: return $this->displayTime;
333: }
334:
335: /**
336: * Amount in inventory for this item along with the units – for example "10.0 lb"
337: *
338: * @param string $inventory
339: */
340: public function setInventory($inventory)
341: {
342: $this->inventory = $inventory;
343: }
344:
345: /**
346: * Amount in inventory for this item along with the units – for example "10.0 lb"
347: *
348: * @return string
349: */
350: public function getInventory()
351: {
352: return $this->inventory;
353: }
354:
355: }
356: