You are here

public function FieldBlockController::isBlockableEntityType in Field as Block 8.2

Determine if Entity Type should have field block created.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $type: Entity type name.

Return value

bool True if field block should be created.

File

src/Controller/FieldBlockController.php, line 39

Class

FieldBlockController
Class FieldBlockController.

Namespace

Drupal\fieldblock\Controller

Code

public function isBlockableEntityType(EntityTypeInterface $type) {
  static $entity_types;
  if (!$entity_types) {
    $entity_types = $this
      ->getEnabledEntityTypes();
  }
  return in_array($type
    ->id(), $entity_types);
}