Skip to content

Instantly share code, notes, and snippets.

@mikeyp mikeyp/gist:6993726
Created Oct 15, 2013

What would you like to do?
protected function get_entity_type() {
$class = get_class($this);
$types = entity_get_info();
foreach ($types as $entity_type => $info) {
if (isset($info['entity class']) && $class == $info['entity class']) {
return $entity_type;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.