You are here

public function DomainEntityMapper::getEntityTypes in Domain Access Entity 8

Returns fieldable entity type definitions.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The fieldable entity types.

1 call to DomainEntityMapper::getEntityTypes()
DomainEntityMapper::getEnabledEntityTypes in src/DomainEntityMapper.php
Returns entity types that have domain access field storage.

File

src/DomainEntityMapper.php, line 74

Class

DomainEntityMapper
Provides fields operations for domain entity module fields.

Namespace

Drupal\domain_entity

Code

public function getEntityTypes() {
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  $result = [];
  foreach ($entity_types as $entity_type_id => $entity_type) {
    if ($entity_type
      ->entityClassImplements(FieldableEntityInterface::class)) {
      $result[$entity_type_id] = $entity_type;
    }
  }
  return $result;
}