You are here

protected function CriticalCssProvider::isEntityIdExcluded in Critical CSS 8

Check if entity id is excluded by configuration.

Parameters

int $entityId: Entity ID (integer).

Return value

bool True if entity is excluded.

1 call to CriticalCssProvider::isEntityIdExcluded()
CriticalCssProvider::calculateFilePaths in src/Asset/CriticalCssProvider.php
Get all possible paths to search, relatives to theme.

File

src/Asset/CriticalCssProvider.php, line 203

Class

CriticalCssProvider
Critical CSS Provider.

Namespace

Drupal\critical_css\Asset

Code

protected function isEntityIdExcluded($entityId) {
  $excludedIds = explode("\n", $this->config
    ->get('excluded_ids'));
  $excludedIds = array_map(function ($item) {
    return trim($item);
  }, $excludedIds);
  return is_array($excludedIds) && in_array($entityId, $excludedIds);
}