mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3817: hydrating many-to-many relation crashes, when trying to access auto created adder with collection (instead of single entity) #4676
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 10, 2015).
Originally assigned to: @deeky666 on GitHub.
Jira issue originally created by user stomalak:
my concern
IF Doctrine\ORM\Tools\EntityGenerator::generateEntityStubMethods (auto) generates adder, which will expect the parameter to be {color:red}target entity{color}
WHY would DoctrineModule\Stdlib\Hydrator\Strategy\AllowRemoveByValue::hydrate call this very same adder, passing an {color:red}ArrayCollection{color}
auto generated code:
outline of a (quick) workaround:
(Same goes for removing elements from any "to-many"-collection.)
my question\s
Did I miss something on my way?
Is there any way to "enable" some kind of "multi-adding"?
Is there any chance to (further) influence that adding-part with my xml declaration?
Any advice is very welcome.
Maybe I could write my own EntityGenerator. Maybe I should use a custom Hydrator. But right now it seems to me like a little inconsistency in the library.
@doctrinebot commented on GitHub (Jul 10, 2015):
Comment created by stomalak:
created twice (maybe a subconscious double click)
@doctrinebot commented on GitHub (Aug 21, 2015):
Comment created by stomalak:
I accidently set the reolution to duplicate, which might have cause that the remaining issue is no longer open (but I'm not quite shure)..
@doctrinebot commented on GitHub (Aug 21, 2015):
Comment created by stomalak:
.. my fault.. I was wondering if "resolving as duplicate" might be the right way to close duplicate issues.. but it seems so
@doctrinebot commented on GitHub (Aug 21, 2015):
Issue was closed with resolution "Duplicate"