You are here

public function MultiversionManager::isSupportedEntityType in Multiversion 8

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

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type:

Return value

boolean

Overrides MultiversionManagerInterface::isSupportedEntityType

2 calls to MultiversionManager::isSupportedEntityType()
MultiversionManager::getSupportedEntityTypes in src/MultiversionManager.php
MultiversionManager::isEnabledEntityType in src/MultiversionManager.php

File

src/MultiversionManager.php, line 183

Class

MultiversionManager

Namespace

Drupal\multiversion

Code

public function isSupportedEntityType(EntityTypeInterface $entity_type) {
  $supported_entity_types = \Drupal::config('multiversion.settings')
    ->get('supported_entity_types') ?: [];
  if (empty($supported_entity_types)) {
    return FALSE;
  }
  if (!in_array($entity_type
    ->id(), $supported_entity_types)) {
    return FALSE;
  }
  return $entity_type instanceof ContentEntityTypeInterface;
}