You are here

public function RemoveNonPublicFiles::onFilterFields in Acquia Content Hub 8.2

Filter fields.

Parameters

\Drupal\depcalc\Event\FilterDependencyCalculationFieldsEvent $event: Filter Dependency Calculation Fields.

File

src/EventSubscriber/FilterDeps/RemoveNonPublicFiles.php, line 60

Class

RemoveNonPublicFiles
Class RemoveNonPublicFiles.

Namespace

Drupal\acquia_contenthub\EventSubscriber\FilterDeps

Code

public function onFilterFields(FilterDependencyCalculationFieldsEvent $event) {
  $fields = array_filter($event
    ->getFields(), function ($field) {
    return $this
      ->includeField($field);
  }, ARRAY_FILTER_USE_BOTH);
  $event
    ->setFields(...$fields);
}