|
@@ -39,9 +39,9 @@ discard block |
|
|
block discarded – undo |
|
39
|
39
|
public function loadValuesForChoices(array $choices, $value = null) { |
|
40
|
40
|
// is called on form creat with $choices containing the preset of the bound entity |
|
41
|
41
|
$values = array(); |
|
42
|
|
- foreach($choices as $key => $choice) { |
|
|
42
|
+ foreach ($choices as $key => $choice) { |
|
43
|
43
|
// we use a DataTransformer, thus only plain values arrive as choices which can be used directly as value |
|
44
|
|
- if(is_callable($value)) { |
|
|
44
|
+ if (is_callable($value)) { |
|
45
|
45
|
$values[$key] = (string)call_user_func($value, $choice, $key); |
|
46
|
46
|
} else { |
|
47
|
47
|
$values[$key] = $choice; |
|
@@ -85,9 +85,9 @@ discard block |
|
|
block discarded – undo |
|
85
|
85
|
public function loadChoicesForValues(array $values, $value = null) { |
|
86
|
86
|
// is called on form submit after loadValuesForChoices of form create and loadChoiceList of form view create |
|
87
|
87
|
$choices = array(); |
|
88
|
|
- foreach($values as $key => $val) { |
|
|
88
|
+ foreach ($values as $key => $val) { |
|
89
|
89
|
// we use a DataTransformer, thus only plain values arrive as choices which can be used directly as value |
|
90
|
|
- if(is_callable($value)) { |
|
|
90
|
+ if (is_callable($value)) { |
|
91
|
91
|
$choices[$key] = (string)call_user_func($value, $val, $key); |
|
92
|
92
|
} else { |
|
93
|
93
|
$choices[$key] = $val; |
Please login to merge, or discard this patch.