function isEntity(string $classFQCN) : bool
    {
        if ( ! class_exists($classFQCN)) {

            throw new ClassNotFoundException(sprintf('Given class FQCN "%s" does not exist.', $classFQCN));
        }

        if ( ! is_object($classFQCN)) {

            throw new EntityNotFoundException(sprintf('Given class "%s" is not a Doctrine Entity.', $classFQCN));
        }

        return ! $this->getObjectManager()
                      ->getMetadataFactory()
                      ->isTransient(ClassUtils::getClass($classFQCN));
    }
function isEntity(string $classFQCN) : bool
    {
        if ( ! class_exists($classFQCN)) {

            throw new ClassNotFoundException(sprintf('Given class FQCN "%s" does not exist.', $classFQCN));
        }

        if ( ! is_object($classFQCN)) {

            throw new EntityNotFoundException(sprintf('Given class "%s" is not a Doctrine Entity.', $classFQCN));
        }

        return ! $this->getObjectManager()
                      ->getMetadataFactory()
                      ->isTransient(ClassUtils::getClass($classFQCN));
    }
function isEntity ( string $ classFQCN ) : bool { if ( ! class_exists ( $ classFQCN ) ) { throw new ClassNotFoundException ( sprintf ( 'Given class FQCN "%s" does not exist.' , $ classFQCN ) ) ; } if ( ! is_object ( $ classFQCN ) ) { throw new EntityNotFoundException ( sprintf ( 'Given class "%s" is not a Doctrine Entity.' , $ classFQCN ) ) ; } return ! $ this -> getObjectManager ( ) -> getMetadataFactory ( ) -> isTransient ( ClassUtils :: getClass ( $ classFQCN ) ) ; }
Tests if a received class name is in fact a Doctrine Entity

Based on @link https://stackoverflow.com/a/27121978/1155833

@param string $classFQCN

@return boolean
@throws EntityNotFoundException
Tests if a received class name is in fact a Doctrine Entity