对不起,如果这是一个重复的问题,因为我似乎找不到问题在我的代码中。
在终端php vendor/bin/doctrine-migrations migrations:diff中运行代码后,将得到以下错误

我不知道这个错误是从哪里来的。
更新
当我运行php vendor/bin/doctrine orm:info时,我在终端中得到以下输出
! [CAUTION] You do not have any mapped Doctrine ORM entities according to the current configuration.
! If you have entities or mapping files you should check your mapping configuration for errors.
干杯!
发布于 2018-11-21 13:11:54
更新
我在mijn配置中遗漏了2行代码,下面是这些代码。
$platform = $entityManager->getConnection()->getDatabasePlatform(); $platform->registerDoctrineTypeMapping('enum', 'string');
添加了这2行,现在我没有任何映射问题。
现在,使用下面的链接No mapped Doctrine ORM entities according to the current configuration,这个堆栈问题将解释当您遇到这个问题时需要做什么
UPDATE发现我使用的是@ORM/Entity,当我将它更改为@Entity时,它起了作用。我对此做了更深入的研究,发现"useSimpleAnnotationReader“是真的,所以如果您将其改为false并删除最后2行代码,它就会运行得非常好。现在看起来是这样的
$config = Setup::createAnnotationMetadataConfiguration(
$paths,
$isDevMode,
null,
null,
false);最后一个是"useSimpleAnnotationReader“,我把这个放在bootstrap.php里
干杯!
发布于 2022-05-12 14:58:10
对我来说,问题是我没有增加
/**
* @ORM\Entity()
*/以上实体。
https://stackoverflow.com/questions/53409594
复制相似问题