mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3228: ORM\Tools\Export\Driver\PhpExporter.php does not properly export manyToOne associations #3996
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 @doctrinebot on GitHub (Jul 24, 2014).
Originally assigned to: @Majkl578 on GitHub.
Jira issue originally created by user bigdan@gmail.com:
PhpExporter.php fails to check the association for manyToOne/oneToOne and exports all associations as oneToOne.
See https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php#L116 where oneToOne is hardcoded if the bitmask matches either manyToOne or oneToOne.
As opposed to YamlExporter.php:
https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php#L165
Which does roughly the same thing, but then properly sets the association type by checking the actual association on lines 186 through one 190:
https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php#L186-L190
@zorji commented on GitHub (Dec 18, 2015):
I am having the same issue.
To reproduce, use the following annotated entities
Run
$ ./vendor/bin/doctrine orm:convert:mapping php ./mappingThe converted PHP mapping
@Majkl578 commented on GitHub (Dec 19, 2017):
ORM\Tools\Export\Driver\PhpExporter will be dropped in Doctrine 3.0.