1: <?php
2:
3:
4: namespace BeerXML\Parser;
5:
6:
7: class Style extends Record
8: {
9: protected $tagName = 'STYLE';
10:
11: 12: 13: 14: 15:
16: protected $simpleProperties = array(
17: 'NAME' => 'setName',
18: 'VERSION' => 'setVersion',
19: 'CATEGORY' => 'setCategory',
20: 'CATEGORY_NUMBER' => 'setCategoryNumber',
21: 'STYLE_LETTER' => 'setStyleLetter',
22: 'STYLE_GUIDE' => 'setStyleGuide',
23: 'TYPE' => 'setType',
24: 'OG_MIN' => 'setOgMin',
25: 'OG_MAX' => 'setOgMax',
26: 'FG_MIN' => 'setFgMin',
27: 'FG_MAX' => 'setFgMax',
28: 'IBU_MIN' => 'setIbuMin',
29: 'IBU_MAX' => 'setIbuMax',
30: 'COLOR_MIN' => 'setColorMin',
31: 'COLOR_MAX' => 'setColorMax',
32: 'ABV_MIN' => 'setAbvMin',
33: 'ABV_MAX' => 'setAbvMax',
34: 'CARB_MIN' => 'setCarbMin',
35: 'CARB_MAX' => 'setCarbMax',
36: 'NOTES' => 'setNotes',
37: 'PROFILE' => 'setProfile',
38: 'INGREDIENTS' => 'setIngredients',
39: 'EXAMPLES' => 'setExamples',
40: );
41:
42: 43: 44:
45: protected function createRecord()
46: {
47: $style = $this->recordFactory->getStyle();
48: if ($style instanceof IStyleDisplay) {
49: $this->simpleProperties = array_merge(
50: $this->simpleProperties,
51: array(
52: 'DISPLAY_OG_MIN' => 'setDisplayOgMin',
53: 'DISPLAY_OG_MAX' => 'setDisplayOgMax',
54: 'DISPLAY_FG_MIN' => 'setDisplayFgMin',
55: 'DISPLAY_FG_MAX' => 'setDisplayFgMax',
56: 'DISPLAY_COLOR_MIN' => 'setDisplayColorMin',
57: 'DISPLAY_COLOR_MAX' => 'setDisplayColorMax',
58: 'OG_RANGE' => 'setOgRange',
59: 'FG_RANGE' => 'setFgRange',
60: 'IBU_RANGE' => 'setIbuRange',
61: 'CARB_RANGE' => 'setCarbRange',
62: 'COLOR_RANGE' => 'setColorRange',
63: 'ABV_RANGE' => 'setAbvRange',
64: )
65: );
66: }
67: return $style;
68: }
69:
70: }