【问题标题】:Doctrine 2.13.2 Warning: Object of class Enum could not be converted to intDoctrine 2.13.2 警告:Enum 类的对象无法转换为 int
【发布时间】:2022-10-16 00:44:40
【问题描述】:

自上周以来,我注意到我正在开发的应用程序中的几个地方存在问题。经过调查,我发现与

composer require doctrine/orm 2.13.1

一切都很好,但有:

composer require doctrine/orm 2.13.2

应用程序在我在查询中使用枚举的地方刹车,例如:

$builder->...->setParameter('type', Type::VARIANT) // Type is enum

我试图阅读它: herehere 但我没有看到有关此的信息。 错误写在标题中。

字段通过 xml 映射 name="type" type="smallint" enum-type="Type"。它是有效的,工作了几个月。

有谁知道为什么对枚举的学说支持不起作用,或者如果不知道是什么原因导致这个问题?

【问题讨论】:

    标签: php enums doctrine-orm php-8.1


    【解决方案1】:

    可能与https://github.com/doctrine/orm/issues/10066 有关,所以我会说降级到 2.13.1 并等待 2.13.4

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-02
      • 2017-03-08
      • 2019-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-16
      相关资源
      最近更新 更多