public static function Util::removeUnselectedFields in Charts 8.3
Same name and namespace in other branches
- 8.4 src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()
- 8 src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()
- 5.0.x src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()
Removes unselected fields.
Parameters
array $valueField: Value Field.
Return value
array Field Values.
1 call to Util::removeUnselectedFields()
- template_preprocess_views_view_charts in ./
charts.module - Implements template_preprocess_hook().
File
- src/
Util/ Util.php, line 68
Class
- Util
- Util.
Namespace
Drupal\charts\UtilCode
public static function removeUnselectedFields(array $valueField = []) {
$fieldValues = [];
foreach ($valueField as $key => $value) {
if (!empty($value)) {
$fieldValues[$key] = $value;
}
}
return $fieldValues;
}