You are here

protected function DefaultsSectionStorage::getEntityTypes in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage::getEntityTypes()

Returns an array of relevant entity types.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] An array of entity types.

1 call to DefaultsSectionStorage::getEntityTypes()
DefaultsSectionStorage::buildRoutes in core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php
Provides the routes needed for Layout Builder UI.

File

core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php, line 210

Class

DefaultsSectionStorage
Defines the 'defaults' section storage type.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

protected function getEntityTypes() {
  return array_filter($this->entityTypeManager
    ->getDefinitions(), function (EntityTypeInterface $entity_type) {
    return $entity_type
      ->entityClassImplements(FieldableEntityInterface::class) && $entity_type
      ->hasHandlerClass('form', 'layout_builder') && $entity_type
      ->hasViewBuilderClass() && $entity_type
      ->get('field_ui_base_route');
  });
}