mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Setting manually generators #5421
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 @tabbi89 on GitHub (Feb 20, 2017).
Originally assigned to: @Ocramius on GitHub.
I have encounter problem where I have entity which has property
GeneratedValueid with strategyAUTOWhat I tried to achieve was to add two Category entities with one set id manually.
This is how it works but I when I uncomment first flush I get error during adding second entity to database:
As we see param with id is set but value is not mapped. My question is: Is this a desire behaviour ?
@Ocramius commented on GitHub (Feb 20, 2017):
@tabbi89 you can't really change mapping information at runtime: can you try this by changing metadata before executing these operations?
@tabbi89 commented on GitHub (Feb 20, 2017):
@Ocramius I am using this in behat scenarios - so I have background step which adds admin user and second step which adds specified user with concrete id :) I would have to change mapping for all but that includes generating ids in for this entity in all steps.
Any other option that you suggest ?
@Ocramius commented on GitHub (Feb 20, 2017):
That's what a fixture would do for you. Changing mapping at runtime is not something supported. If you can't reproduce this failure without the runtime mapping change, I'll close this as
invalid@tabbi89 commented on GitHub (Feb 20, 2017):
Thanks, you can close it as invalid
@Ocramius commented on GitHub (Feb 20, 2017):
@tabbi89 thanks for clarifying! 👍