You are here

public static function Util::removeHiddenFields in Charts 8.3

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

Parameters

$view:

$fieldValues:

Return value

array

1 call to Util::removeHiddenFields()
template_preprocess_views_view_charts in ./charts.module
Implements template_preprocess_hook().

File

src/Util/Util.php, line 84

Class

Util
Util.

Namespace

Drupal\charts\Util

Code

public static function removeHiddenFields($view, $fieldValues) {
  $fields = $view->display_handler
    ->getOption('fields');
  $visibleFields = array_filter($fields, function ($field) {
    return !empty($field['exclude']);
  });
  $visibleFields = array_diff_key($fieldValues, $visibleFields);
  return $visibleFields;
}