diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 0e3c8ba..b69ba1d 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -432,7 +432,11 @@ public static function loadMultiple(array $ids = NULL) { } /** - * Tries to guess an entity type ID based on the class that is called. + * Returns the entity type ID based on the class that is called on. + * + * Compares the class this is called on against the known entity classes + * and returns the entity type ID of a direct match or a subclass as fallback, + * to support entity type definitions that were altered. * * @return string * The entity type ID. @@ -441,6 +445,9 @@ public static function loadMultiple(array $ids = NULL) { * Thrown when multiple subclasses correspond to the called class. * @throws \Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException * Thrown when no entity class corresponds to the called class. + * + * @see \Drupal\Core\Entity\Entity::load() + * @see \Drupal\Core\Entity\Entity::loadMultiple() */ protected static function getEntityTypeFromStaticClass() { $called_class = get_called_class();