public EntityTypeRepositoryInterface::getEntityTypeFromClass($class_name)
Gets 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.
string $class_name: Class name to use for searching the entity type ID.
string The entity type ID.
\Drupal\Core\Entity\Exception\AmbiguousEntityClassException Thrown when multiple subclasses correspond to the called class.
\Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException Thrown when no entity class corresponds to the called class.
\Drupal\Core\Entity\Entity::load()
\Drupal\Core\Entity\Entity::loadMultiple()
public function getEntityTypeFromClass($class_name);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityTypeRepositoryInterface.php/function/EntityTypeRepositoryInterface::getEntityTypeFromClass/8.1.x