1: <?php
2:
3:
4: namespace BeerXML\Record;
5:
6:
7: use BeerXML\Generator\IHopDisplay as HopGetter;
8: use BeerXML\Parser\IHopDisplay as HopSetter;
9:
10: class Hop implements HopGetter, HopSetter
11: {
12:
13: const USE_BOIL = 'Boil';
14: const USE_DRY_HOP = 'Dry Hop';
15: const USE_MASH = 'Mash';
16: const USE_FIRST_WORT = 'First Wort';
17: const USE_AROMA = 'Aroma';
18: const TYPE_BITTERING = 'Bittering';
19: const TYPE_AROMA = 'Aroma';
20: const TYPE_BOTH = 'Both';
21: const FORM_PELLET = 'Pellet';
22: const FORM_PLUG = 'Plug';
23: const FORM_LEAF = 'Leaf';
24:
25: /**
26: * @var string
27: */
28: private $name;
29:
30: /**
31: * @var int
32: */
33: private $version = 1;
34:
35: /**
36: * @var number Percentage
37: */
38: private $alpha;
39:
40: /**
41: * @var number Weight (kg)
42: */
43: private $amount;
44:
45: /**
46: * @var string "Boil", "Dry Hop", "Mash", "First Wort" or "Aroma"
47: */
48: private $use;
49:
50: /**
51: * @var number Time (min)
52: */
53: private $time;
54:
55: /**
56: * @var string
57: */
58: private $notes;
59:
60: /**
61: * @var string "Bittering", "Aroma" or "Both"
62: */
63: private $type;
64:
65: /**
66: * @var string "Pellet", "Plug" or "Leaf"
67: */
68: private $form;
69:
70: /**
71: * @var number Percentage
72: */
73: private $beta;
74:
75: /**
76: * @var number Percentage
77: */
78: private $hsi;
79:
80: /**
81: * @var string
82: */
83: private $origin;
84:
85: /**
86: * @var string
87: */
88: private $substitutes;
89:
90: /**
91: * @var number Percentage
92: */
93: private $humulene;
94:
95: /**
96: * @var number Percentage
97: */
98: private $caryophyllene;
99:
100: /**
101: * @var number Percentage
102: */
103: private $cohumulone;
104:
105: /**
106: * @var number Percentage
107: */
108: private $myrcene;
109:
110: /** Fields from Appendix A Optional Extensions for BeerXML Display **/
111:
112: /**
113: * @var string
114: */
115: private $displayAmount;
116:
117: /**
118: * @var string
119: */
120: private $inventory;
121:
122: /**
123: * @var string
124: */
125: private $displayTime;
126:
127: /**
128: * Percent alpha of hops - for example "5.5" represents 5.5% alpha
129: *
130: * @param number $alpha
131: */
132: public function setAlpha($alpha)
133: {
134: $this->alpha = $alpha;
135: }
136:
137: /**
138: * Percent alpha of hops - for example "5.5" represents 5.5% alpha
139: *
140: * @return number
141: */
142: public function getAlpha()
143: {
144: return $this->alpha;
145: }
146:
147: /**
148: * Weight in Kilograms of the hops used in the recipe
149: *
150: * @param number $amount
151: */
152: public function setAmount($amount)
153: {
154: $this->amount = $amount;
155: }
156:
157: /**
158: * Weight in Kilograms of the hops used in the recipe
159: *
160: * @return number
161: */
162: public function getAmount()
163: {
164: return $this->amount;
165: }
166:
167: /**
168: * Hop beta percentage - for example "4.4" denotes 4.4 % beta
169: *
170: * @param number $beta
171: */
172: public function setBeta($beta)
173: {
174: $this->beta = $beta;
175: }
176:
177: /**
178: * Hop beta percentage - for example "4.4" denotes 4.4 % beta
179: *
180: * @return number
181: */
182: public function getBeta()
183: {
184: return $this->beta;
185: }
186:
187: /**
188: * Caryophyllene level in percent.
189: *
190: * @param number $caryophyllene
191: */
192: public function setCaryophyllene($caryophyllene)
193: {
194: $this->caryophyllene = $caryophyllene;
195: }
196:
197: /**
198: * Caryophyllene level in percent.
199: *
200: * @return number
201: */
202: public function getCaryophyllene()
203: {
204: return $this->caryophyllene;
205: }
206:
207: /**
208: * Cohumulone level in percent
209: *
210: * @param number $cohumulone
211: */
212: public function setCohumulone($cohumulone)
213: {
214: $this->cohumulone = $cohumulone;
215: }
216:
217: /**
218: * Cohumulone level in percent
219: *
220: * @return number
221: */
222: public function getCohumulone()
223: {
224: return $this->cohumulone;
225: }
226:
227: /**
228: * May be "Pellet", "Plug" or "Leaf"
229: *
230: * @param string $form
231: */
232: public function setForm($form)
233: {
234: $this->form = $form;
235: }
236:
237: /**
238: * May be "Pellet", "Plug" or "Leaf"
239: *
240: * @return string
241: */
242: public function getForm()
243: {
244: return $this->form;
245: }
246:
247: /**
248: * Hop Stability Index - defined as the percentage of hop alpha lost in 6 months of storage
249: *
250: * @param number $hsi
251: */
252: public function setHsi($hsi)
253: {
254: $this->hsi = $hsi;
255: }
256:
257: /**
258: * Hop Stability Index - defined as the percentage of hop alpha lost in 6 months of storage
259: *
260: * @return number
261: */
262: public function getHsi()
263: {
264: return $this->hsi;
265: }
266:
267: /**
268: * Humulene level in percent.
269: *
270: * @param number $humulene
271: */
272: public function setHumulene($humulene)
273: {
274: $this->humulene = $humulene;
275: }
276:
277: /**
278: * Humulene level in percent.
279: *
280: * @return number
281: */
282: public function getHumulene()
283: {
284: return $this->humulene;
285: }
286:
287: /**
288: * Myrcene level in percent
289: *
290: * @param number $myrcene
291: */
292: public function setMyrcene($myrcene)
293: {
294: $this->myrcene = $myrcene;
295: }
296:
297: /**
298: * Myrcene level in percent
299: *
300: * @return number
301: */
302: public function getMyrcene()
303: {
304: return $this->myrcene;
305: }
306:
307: /**
308: * Name of the hops
309: *
310: * @param string $name
311: */
312: public function setName($name)
313: {
314: $this->name = $name;
315: }
316:
317: /**
318: * Name of the hops
319: *
320: * @return string
321: */
322: public function getName()
323: {
324: return $this->name;
325: }
326:
327: /**
328: * Textual notes about the hops, usage, substitutes. May be a multiline entry.
329: *
330: * @param string $notes
331: */
332: public function setNotes($notes)
333: {
334: $this->notes = $notes;
335: }
336:
337: /**
338: * Textual notes about the hops, usage, substitutes. May be a multiline entry.
339: *
340: * @return string
341: */
342: public function getNotes()
343: {
344: return $this->notes;
345: }
346:
347: /**
348: * Place of origin for the hops
349: *
350: * @param string $origin
351: */
352: public function setOrigin($origin)
353: {
354: $this->origin = $origin;
355: }
356:
357: /**
358: * Place of origin for the hops
359: *
360: * @return string
361: */
362: public function getOrigin()
363: {
364: return $this->origin;
365: }
366:
367: /**
368: * Substitutes that can be used for this hops
369: *
370: * @param string $substitutes
371: */
372: public function setSubstitutes($substitutes)
373: {
374: $this->substitutes = $substitutes;
375: }
376:
377: /**
378: * Substitutes that can be used for this hops
379: *
380: * @return string
381: */
382: public function getSubstitutes()
383: {
384: return $this->substitutes;
385: }
386:
387: /**
388: * The time as measured in minutes. Meaning is dependent on the "USE" field. For "Boil" this is the boil time.
389: * For "Mash" this is the mash time. For "First Wort" this is the boil time. For "Aroma" this is the steep time.
390: * For "Dry Hop" this is the amount of time to dry hop.
391: *
392: * @param number $time
393: */
394: public function setTime($time)
395: {
396: $this->time = $time;
397: }
398:
399: /**
400: * The time as measured in minutes. Meaning is dependent on the "USE" field. For "Boil" this is the boil time.
401: * For "Mash" this is the mash time. For "First Wort" this is the boil time. For "Aroma" this is the steep time.
402: * For "Dry Hop" this is the amount of time to dry hop.
403: *
404: * @return number
405: */
406: public function getTime()
407: {
408: return $this->time;
409: }
410:
411: /**
412: * May be "Bittering", "Aroma" or "Both"
413: *
414: * @param string $type
415: */
416: public function setType($type)
417: {
418: $this->type = $type;
419: }
420:
421: /**
422: * May be "Bittering", "Aroma" or "Both"
423: *
424: * @return string
425: */
426: public function getType()
427: {
428: return $this->type;
429: }
430:
431: /**
432: * May be "Boil", "Dry Hop", "Mash", "First Wort" or "Aroma". Note that "Aroma" and "Dry Hop" do not contribute to
433: * the bitterness of the beer while the others do. Aroma hops are added after the boil and do not contribute
434: * substantially to beer bitterness.
435: *
436: * @param string $use
437: */
438: public function setUse($use)
439: {
440: $this->use = $use;
441: }
442:
443: /**
444: * May be "Boil", "Dry Hop", "Mash", "First Wort" or "Aroma". Note that "Aroma" and "Dry Hop" do not contribute to
445: * the bitterness of the beer while the others do. Aroma hops are added after the boil and do not contribute
446: * substantially to beer bitterness.
447: *
448: * @return string
449: */
450: public function getUse()
451: {
452: return $this->use;
453: }
454:
455: /**
456: * Should be set to 1 for this version of the XML standard. May be a higher number for later versions but all later
457: * versions shall be backward compatible.
458: *
459: * @param int $version
460: */
461: public function setVersion($version)
462: {
463: $this->version = $version;
464: }
465:
466: /**
467: * Should be set to 1 for this version of the XML standard. May be a higher number for later versions but all later
468: * versions shall be backward compatible.
469: *
470: * @return int
471: */
472: public function getVersion()
473: {
474: return $this->version;
475: }
476:
477: /**
478: * The amount of hops in this record along with the units formatted for easy display in the current user defined
479: * units. For example "100 g" or "1.5 oz".
480: *
481: * @param string $displayAmount
482: */
483: public function setDisplayAmount($displayAmount)
484: {
485: $this->displayAmount = $displayAmount;
486: }
487:
488: /**
489: * The amount of hops in this record along with the units formatted for easy display in the current user defined
490: * units. For example "100 g" or "1.5 oz".
491: *
492: * @return string
493: */
494: public function getDisplayAmount()
495: {
496: return $this->displayAmount;
497: }
498:
499: /**
500: * Time displayed in minutes for all uses except for the dry hop which is in days. For example "60 min", "3 days".
501: *
502: * @param string $displayTime
503: */
504: public function setDisplayTime($displayTime)
505: {
506: $this->displayTime = $displayTime;
507: }
508:
509: /**
510: * Time displayed in minutes for all uses except for the dry hop which is in days. For example "60 min", "3 days".
511: *
512: * @return string
513: */
514: public function getDisplayTime()
515: {
516: return $this->displayTime;
517: }
518:
519: /**
520: * Amount in inventory for this item along with the units – for example "10.0 oz"
521: *
522: * @param string $inventory
523: */
524: public function setInventory($inventory)
525: {
526: $this->inventory = $inventory;
527: }
528:
529: /**
530: * Amount in inventory for this item along with the units – for example "10.0 oz"
531: *
532: * @return string
533: */
534: public function getInventory()
535: {
536: return $this->inventory;
537: }
538:
539: }
540: