You are here

public function DeployLogger::isEntityTypeLoggable in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x src/DeployLogger.php \Drupal\build_hooks\DeployLogger::isEntityTypeLoggable()

Determines if we should log activity related to the passed entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity.

Return value

bool True if we should log it, false otherwise.

File

src/DeployLogger.php, line 73

Class

DeployLogger
Class DeployLogger.

Namespace

Drupal\build_hooks

Code

public function isEntityTypeLoggable(ContentEntityInterface $entity) {
  $entityType = $entity
    ->getEntityTypeId();
  $selectedEntityTypes = $this->configFactory
    ->get('build_hooks.settings')
    ->get('logging.entity_types');
  return in_array($entityType, array_values($selectedEntityTypes), TRUE);
}