You are here

protected static function EntityCreationTrait::getEntity in Select2 Boxes 8

Get an entity by its ID and entity type.

Parameters

string $entity_type_id: Target entity type ID.

string $id: Entity ID.

Return value

\Drupal\Core\Entity\EntityInterface|null The matching entity.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to EntityCreationTrait::getEntity()
AutoCreationProcessTrait::processValueItem in src/AutoCreationProcessTrait.php
Process value item.

File

src/EntityCreationTrait.php, line 28

Class

EntityCreationTrait
Trait EntityCreationTrait.

Namespace

Drupal\select2boxes

Code

protected static function getEntity($entity_type_id, $id) {
  return self::getEntityStorage($entity_type_id)
    ->load($id);
}