Loads a single entity for the given entity type ID.
By providing the language code, the latest revisions affecting the specified translation (language code) will be returned.
string $entity_type_id: The entity type ID.
string $id: The entity ID.
string|null $langcode: (optional) The language code. Defaults to source entity language.
\Drupal\Core\Entity\ContentEntityInterface|null The loaded entity or null if not found.
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
public static function load($entity_type_id, $id, $langcode = NULL) {
$entities = static::loadMultiple($entity_type_id, [
$id,
], $langcode);
return isset($entities[$id]) ? $entities[$id] : NULL;
}