Helper/EntityHelper.php
public function getEntityMetadata($entity)
    {
        if (!$this->isManagedByDoctrine($entity)) {
            return null;
        }

        $cacheKey = 'metadata';
        $entity   = $this->getEntityClassFull($entity);
        $metadata = $this->getFromCache($entity, $cacheKey);

        if (false !== $metadata) {
            return $metadata;
        }

        $metadata = $this->entityManager->getClassMetadata($entity);
        $this->cache[$metadata->getName()][$cacheKey] = $metadata;

        return $metadata;
    }
public function getEntityMetadata($entity)
    {
        if (!$this->isManagedByDoctrine($entity)) {
            return null;
        }

        $cacheKey = 'metadata';
        $entity   = $this->getEntityClassFull($entity);
        $metadata = $this->getFromCache($entity, $cacheKey);

        if (false !== $metadata) {
            return $metadata;
        }

        $metadata = $this->entityManager->getClassMetadata($entity);
        $this->cache[$metadata->getName()][$cacheKey] = $metadata;

        return $metadata;
    }
public function getEntityMetadata ( $ entity ) { if ( ! $ this -> isManagedByDoctrine ( $ entity ) ) { return null ; } $ cacheKey = 'metadata' ; $ entity = $ this -> getEntityClassFull ( $ entity ) ; $ metadata = $ this -> getFromCache ( $ entity , $ cacheKey ) ; if ( false !== $ metadata ) { return $ metadata ; } $ metadata = $ this -> entityManager -> getClassMetadata ( $ entity ) ; $ this -> cache [ $ metadata -> getName ( ) ] [ $ cacheKey ] = $ metadata ; return $ metadata ; }
Returns ClassMetadata object for received entity

@param string|object $entity Entity object or just entity name in the full or shot notation

@return \Doctrine\ORM\Mapping\ClassMetadata|null
Returns ClassMetadata object for received entity