public static function getEntityClassName($entity)
{
if ($entity instanceof OrmProxyInterface) {
return get_parent_class($entity);
} elseif (is_object($entity)) {
return get_class($entity);
} elseif (is_string($entity)) {
return $entity;
} else {
return null;
}
}
/** * Get the metadata for an entity, including column information * * @param string|object $entity Entity or class name of the entity * @return Entity */ public function getEntityMetadata($entity) { $class_name = Reader::getEntityClassName($entity); if (!isset($this->metadata_cache[$class_name])) { $parser = new AnnotationMetadataParser($class_name); $this->metadata_cache[$class_name] = $parser->getEntityMetadata(); } return $this->metadata_cache[$class_name]; }