mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Attempting to use non-attribute class "Doctrine\ORM\Mapping\JoinColumns" as attribute #7020
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DurandA on GitHub (Aug 9, 2022).
JoinColumnscannot be used as a PHP8 attribute:This triggers
Attempting to use non-attribute class "Doctrine\ORM\Mapping\JoinColumns" as attribute.I attempted to patch
JoinColumnsto add attribute support:However, it does not have the expected behavior:
Foo
YearlyBar
Baz
This throws
Column name "id" referenced for relation from App\Entity\Baz towards App\Entity\YearlyBar does not exist. I am not sure if this is due to the attribute support or if I am missusingJoinColumnsas I did not have previous experience with composite keys using Doctrine.@DurandA commented on GitHub (Aug 10, 2022):
There is no need for a
JoinColumnsattribute asJoinColumattributes can be repeated as follows: