How can I find out what entity type an entity is, when all I know is the entity ID?
Or is there a way I could list all the entity types on my website (or even via database)?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Different entities use the same ID.
E.g. you can have a user with ID 42, and a node with ID 42, and a taxonomy term with ID 42. So just knowing the ID is 42 is not enough to know what type of entity the ID belongs to.
This is why entity_load takes both the entity type and the ID as arguments.
To list all entities use entity_get_info().