|
14 | 14 | $proposedValue = null; |
15 | 15 | $modifiedValues = []; |
16 | 16 |
|
17 | | - {% if not generatorConfiguration.isImmutable() %} |
| 17 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
18 | 18 | $originalPropertyValidationState = $this->_propertyValidationState ?? []; |
19 | 19 | {% endif %} |
20 | 20 |
|
|
24 | 24 |
|
25 | 25 | {% foreach compositionProperties as compositionProperty %} |
26 | 26 | try { |
27 | | - {% if not generatorConfiguration.isImmutable() %} |
| 27 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
28 | 28 | // check if the state of the validator is already known. |
29 | 29 | // If none of the properties affected by the validator are changed the validator must not be re-evaluated |
30 | 30 | if (isset($validatorIndex) && |
|
71 | 71 | {% if generatorConfiguration.collectErrors() %} |
72 | 72 | $compositionErrorCollection[] = $this->_errorRegistry; |
73 | 73 |
|
74 | | - {% if not generatorConfiguration.isImmutable() %} |
| 74 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
75 | 75 | if (isset($validatorIndex)) { |
76 | 76 | $this->_propertyValidationState[$validatorIndex][$validatorComponentIndex] = $this->_errorRegistry; |
77 | 77 | } |
|
91 | 91 | if (is_object($value)) { |
92 | 92 | $modifiedValues = array_merge($modifiedValues, $this->{{ modifiedValuesMethod }}($originalModelData, $value)); |
93 | 93 | } |
94 | | - {% if not generatorConfiguration.isImmutable() %} |
| 94 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
95 | 95 | {% if not generatorConfiguration.collectErrors() %} |
96 | 96 | if (isset($validatorIndex)) { |
97 | 97 | $this->_propertyValidationState[$validatorIndex][$validatorComponentIndex] = true; |
|
100 | 100 | } |
101 | 101 | {% endif %} |
102 | 102 | } catch (\Exception $e) { |
103 | | - {% if not generatorConfiguration.collectErrors() %} |
104 | | - if (isset($validatorIndex)) { |
105 | | - $this->_propertyValidationState[$validatorIndex][$validatorComponentIndex] = false; |
106 | | - } |
| 103 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
| 104 | + {% if not generatorConfiguration.collectErrors() %} |
| 105 | + if (isset($validatorIndex)) { |
| 106 | + $this->_propertyValidationState[$validatorIndex][$validatorComponentIndex] = false; |
| 107 | + } |
| 108 | + {% endif %} |
107 | 109 | {% endif %} |
108 | 110 |
|
109 | 111 | {% foreach compositionProperty.getAffectedObjectProperties() as affectedObjectProperty %} |
|
137 | 139 |
|
138 | 140 | $result = !({{ composedValueValidation }}); |
139 | 141 |
|
140 | | - {% if not generatorConfiguration.isImmutable() %} |
| 142 | + {% if viewHelper.isMutableBaseValidator(generatorConfiguration, isBaseValidator) %} |
141 | 143 | if ($result) { |
142 | 144 | $this->_propertyValidationState = $originalPropertyValidationState; |
143 | 145 | } |
|
0 commit comments