Doctrine2 - No Metadata Classes to process

前端 未结 9 2053
清歌不尽
清歌不尽 2020-12-13 06:15

Something is wrong with documentation or me. I do all what documentation says.

When i put in terminal :

$ php vendor/bin/doctrine orm:schema-tool:c         


        
9条回答
  •  隐瞒了意图╮
    2020-12-13 06:47

    Had the same issue with custom Doctrine installation. My solution was to re-set metadata driver:

    $config->setMetadataDriverImpl(
        new Doctrine\ORM\Mapping\Driver\AnnotationDriver(
            new Doctrine\Common\Annotations\CachedReader(
                new Doctrine\Common\Annotations\AnnotationReader(),
                new Doctrine\Common\Cache\ArrayCache()
            ),
            ENTITY_DIR
        )
    );
    

    Solution from http://support.skipper18.com/1120/how-use-external-tools-generate-doctrine-getters-and-setters?show=1121#a1121 My scenario was generating entities from existing database

    The newDefaultAnnotationDriver adds the namespace and the method comments state the following:

    If $useSimpleAnnotationReader is true, the notation @Entity will work, otherwise, the notation @ORM\Entity will be supported.

提交回复
热议问题