How to define an entity type within entity_get_info() Is it possible to define your own entity type so that a call to entity_get_info() returns your new type?
I found it. You use the hook_entity_info() hook.

https://www.drupal.org/node/1026420