1 | <?php |
||
25 | class FieldViewHelperService implements SingletonInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var Field |
||
29 | */ |
||
30 | protected $currentField; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $fieldOptions = []; |
||
36 | |||
37 | /** |
||
38 | * Reset every state that can be used by this service. |
||
39 | */ |
||
40 | public function resetState() |
||
44 | |||
45 | /** |
||
46 | * Checks that the `FieldViewHelper` has been called. If not, an exception |
||
47 | * is thrown. |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function fieldContextExists() |
||
55 | |||
56 | /** |
||
57 | * Returns the current field which was defined by the `FieldViewHelper`. |
||
58 | * |
||
59 | * Returns null if no current field was found. |
||
60 | * |
||
61 | * @return Field|null |
||
62 | */ |
||
63 | public function getCurrentField() |
||
67 | |||
68 | /** |
||
69 | * @param Field $field |
||
70 | */ |
||
71 | public function setCurrentField(Field $field) |
||
75 | |||
76 | /** |
||
77 | * @param string $name |
||
78 | * @param mixed $value |
||
79 | */ |
||
80 | public function setFieldOption($name, $value) |
||
84 | |||
85 | /** |
||
86 | * @return array |
||
87 | */ |
||
88 | public function getFieldOptions() |
||
92 | |||
93 | /** |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function resetFieldOptions() |
||
102 | |||
103 | /** |
||
104 | * Unset the current field. |
||
105 | * |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function removeCurrentField() |
||
114 | |||
115 | /** |
||
116 | * Checks that the `FieldViewHelper` has been called. If not, an exception |
||
117 | * is thrown. |
||
118 | * |
||
119 | * @throws ContextNotFoundException |
||
120 | */ |
||
121 | public function checkIsInsideFieldViewHelper() |
||
130 | } |
||
131 |