Conditions | 6 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function updateSearchableFields(&$fields) |
||
26 | { |
||
27 | $matches = []; |
||
28 | $owner = $this->getOwner(); |
||
29 | $candidates = $owner->config()->get('db'); |
||
30 | if (count($candidates) > 0) { |
||
31 | foreach ($candidates as $fieldName => $type) { |
||
32 | if (0 === stripos($type, 'Boolean')) { |
||
33 | $matches[$fieldName] = $fieldName; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | $labels = $owner->fieldLabels(false); |
||
38 | foreach (array_keys($fields) as $fieldName) { |
||
39 | if (isset($matches[$fieldName])) { |
||
40 | $fields[$fieldName]['field'] = DropdownField::create( |
||
41 | $fieldName, |
||
42 | $labels[$fieldName], |
||
43 | self::dropdown_source_for_boolean_fields() |
||
44 | ); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | |||
49 | return $fields; |
||
50 | } |
||
52 |