You are here

protected function DistroIgnoreFilter::activeRead in Config Distro 8

Read from the active configuration.

Parameters

string $name: The name of the configuration to read.

mixed $data: The data to be filtered.

Return value

mixed The data filtered or read from the active storage.

2 calls to DistroIgnoreFilter::activeRead()
DistroIgnoreFilter::filterRead in modules/config_distro_ignore/src/Plugin/ConfigFilter/DistroIgnoreFilter.php
DistroIgnoreFilter::filterReadMultiple in modules/config_distro_ignore/src/Plugin/ConfigFilter/DistroIgnoreFilter.php

File

modules/config_distro_ignore/src/Plugin/ConfigFilter/DistroIgnoreFilter.php, line 183

Class

DistroIgnoreFilter
Provides a ignore filter that resets config to the active one.

Namespace

Drupal\config_distro_ignore\Plugin\ConfigFilter

Code

protected function activeRead($name, $data) {
  if (in_array($name, $this->configuration['all_collections'])) {
    return $this
      ->getSourceStorage()
      ->read($name);
  }
  $hash = self::hashConfig($data);
  $hashes = $this
    ->getIgnoredHash($name);
  if (in_array('', $hashes) || in_array($hash, $hashes)) {
    return $this
      ->getSourceStorage()
      ->read($name);
  }
  return $data;
}