Created
October 15, 2013 15:48
-
-
Save mikeyp/6993726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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