You are here

public function EntityHelper::entityTypeIsAtomic in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 8.2 src/EntityHelper.php \Drupal\simple_sitemap\EntityHelper::entityTypeIsAtomic()

Checks whether an entity type does not provide bundles.

Parameters

string $entity_type_id: The entity type ID.

Return value

bool TRUE if the entity type is atomic and FALSE otherwise.

1 call to EntityHelper::entityTypeIsAtomic()
EntityHelper::getEntityInstanceIds in src/EntityHelper.php
Gets the entity IDs by entity type and bundle.

File

src/EntityHelper.php, line 136

Class

EntityHelper
Helper class for working with entities.

Namespace

Drupal\simple_sitemap

Code

public function entityTypeIsAtomic($entity_type_id) {

  // Menu fix.
  if ($entity_type_id === 'menu_link_content') {
    return FALSE;
  }
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  if (!isset($entity_types[$entity_type_id])) {

    // todo: Throw exception.
  }
  return empty($entity_types[$entity_type_id]
    ->getBundleEntityType()) ? TRUE : FALSE;
}