【问题标题】:ORM No mapping information to processORM 没有要处理的映射信息
【发布时间】:2023-03-14 19:55:01
【问题描述】:

对不起,如果这是一个重复的问题,因为我似乎无法在我的代码中找到问题所在。

在终端 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.

干杯!

【问题讨论】:

    标签: orm doctrine migration


    【解决方案1】:

    更新

    我在 mijn 配置中遗漏了 2 行代码,然后是这些代码。

    $platform = $entityManager->getConnection()->getDatabasePlatform(); $platform->registerDoctrineTypeMapping('enum', 'string');

    添加了这两行,现在我没有遇到任何映射问题。

    Ow 并使用了以下链接 No mapped Doctrine ORM entities according to the current configuration 这个堆栈问题将解释您遇到此问题时需要做什么

    更新 发现我正在使用@ORM/Entity,当我将它更改为@Entity 时它起作用了。我对此进行了更深入的研究,发现“useSimpleAnnotationReader”是真的,所以如果你把它设置为假并删除最后两行代码,它工作得很好。现在看起来像这样

    $config = Setup::createAnnotationMetadataConfiguration(
    $paths,
    $isDevMode,
    null,
    null,
    false);
    

    最后一个是“useSimpleAnnotationReader”,我把它放在 bootstrap.php 中

    干杯!

    【讨论】:

    • 将useSimpleAnnotationReader 设置为false 正是我所需要的。谢谢!
    猜你喜欢
    • 2018-12-06
    • 2015-08-17
    • 1970-01-01
    • 2014-12-14
    • 1970-01-01
    • 2017-10-02
    • 1970-01-01
    • 2018-06-21
    • 1970-01-01
    相关资源
    最近更新 更多