You are here

public function MultiversionManager::isEnabledEntityType in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/MultiversionManager.php \Drupal\multiversion\MultiversionManager::isEnabledEntityType()

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type:

Return value

boolean

Overrides MultiversionManagerInterface::isEnabledEntityType

2 calls to MultiversionManager::isEnabledEntityType()
MultiversionManager::allowToAlter in src/MultiversionManager.php
MultiversionManager::getEnabledEntityTypes in src/MultiversionManager.php

File

src/MultiversionManager.php, line 212

Class

MultiversionManager

Namespace

Drupal\multiversion

Code

public function isEnabledEntityType(EntityTypeInterface $entity_type) {
  if ($this
    ->isSupportedEntityType($entity_type)) {
    $entity_type_id = $entity_type
      ->id();
    $migration_done = $this->state
      ->get("multiversion.migration_done.{$entity_type_id}", FALSE);
    $enabled_entity_types = \Drupal::config('multiversion.settings')
      ->get('enabled_entity_types') ?: [];
    if ($migration_done && in_array($entity_type_id, $enabled_entity_types)) {
      return TRUE;
    }
  }
  return FALSE;
}