mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #9955] fix: disabling versioning #12001
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?
Original Pull Request: https://github.com/doctrine/orm/pull/9955
State: closed
Merged: No
When ClassMetadataInfo has the version field information (versioning),
->setVersioned(false)will set therequiresFetchAfterChangeflag to invalid if "generated" fields are not mapped. This PR fixes setting the flag state.The consequence of the invalid state of
requiresFetchAfterChangeis the generation of invalid queries by the BasicEntityPersister::fetchVersionAndNotUpsertableValues method during the INSERT and UPDATE operations.In this PR, I added two tests that verify the state after the
setVersioned(false)operation is performed.Why
setVersioned(...)is public and not restricted (by comments or doc) method. It is possible to callsetVersioned(false)aftersetVersionMapping(...)which will produce invalid state. In some cases we need to overwrite state to achieve business feature f.e. to disable version verification during flush() in app with annotated entities with @Version.