Skip to content

Drupal\helper\EntityType

Methods

Name Description
__construct EntityType constructor.
getEntityOptions Get a list of entity options for a select field.

EntityType::__construct

Description

public __construct (\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager)

EntityType constructor.

Parameters

  • (\Drupal\Core\Entity\EntityTypeManagerInterface) $entity_type_manager : The entity type manager.

Return Values

void


EntityType::getEntityOptions

Description

public getEntityOptions (string $entity_type_id, array|null $properties)

Get a list of entity options for a select field.

Parameters

  • (string) $entity_type_id : The entity type ID.
  • (array|null) $properties : An optional array of properties to use when loading the entities.

Return Values

array|\Drupal\Core\StringTranslation\TranslatableMarkup[]|string[]

The list of entities keyed by entity ID.