You are here

public static function Util::removeUnselectedFields in Charts 8

Same name and namespace in other branches
  1. 8.4 src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()
  2. 8.3 src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()
  3. 5.0.x src/Util/Util.php \Drupal\charts\Util\Util::removeUnselectedFields()

Removes unselected fields

1 call to Util::removeUnselectedFields()
template_preprocess_views_view_charts in ./charts.module

File

src/Util/Util.php, line 40

Class

Util

Namespace

Drupal\charts\Util

Code

public static function removeUnselectedFields($valueField) {
  $fieldValues = array();
  foreach ($valueField as $key => $value) {
    if (!empty($value)) {
      $fieldValues[$key] = $value;
    }
  }
  return $fieldValues;
}