You are here

public function FieldsHelper::isContentEntityType in Search API 8

Checks whether the given entity type is a content entity type.

Parameters

string $entity_type_id: The ID of the entity type.

Return value

bool TRUE if the $entity_type_id is a valid content entity type, FALSE otherwise.

Overrides FieldsHelperInterface::isContentEntityType

1 call to FieldsHelper::isContentEntityType()
FieldsHelper::getNestedProperties in src/Utility/FieldsHelper.php
Retrieves a list of nested properties from a complex property.

File

src/Utility/FieldsHelper.php, line 388

Class

FieldsHelper
Provides helper methods for dealing with Search API fields and properties.

Namespace

Drupal\search_api\Utility

Code

public function isContentEntityType($entity_type_id) {
  try {
    $definition = $this->entityTypeManager
      ->getDefinition($entity_type_id);
    return $definition
      ->entityClassImplements(ContentEntityInterface::class);
  } catch (PluginNotFoundException $e) {
    return FALSE;
  }
}