【发布时间】:2021-06-20 12:15:11
【问题描述】:
这是我想使用的:
#[ORM\Column(type: "string")]
而不是这个:
/**
* @ORM\Column(type="string")
*/
但我收到此错误:
(error: Class 'Column' is not annotated with 'Attribute' )
是因为 Doctrine 还不支持,还是我遗漏了什么?
【问题讨论】:
-
你有什么用例需要使用这样的注释?你想解决什么问题?
-
如果您有数百个注释并想要转换它们的属性,您可能更愿意自动执行此操作。我写了一个开源工具 Rector 来为你处理这个升级:getrector.org/blog/how-to-upgrade-annotations-to-attributes
标签: php symfony doctrine-orm doctrine php-8