[PR #8600] Remove internal tag from computeChangeSet #11082

Closed
opened 2026-01-22 16:09:39 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/8600

State: closed
Merged: Yes


In the doctrine https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/reference/events.html#onflush

The computeChangeSet is recommended to be used

If you create and persist a new entity in onFlush, then calling EntityManager#persist() is not enough. You have to execute an additional call to $unitOfWork->computeChangeSet($classMetadata, $entity).
Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling $unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity).

So the method shouldn't be flag as internal:

  • To provide a BC-promise
  • To avoid psalm error with internal method
**Original Pull Request:** https://github.com/doctrine/orm/pull/8600 **State:** closed **Merged:** Yes --- In the doctrine https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/reference/events.html#onflush The `computeChangeSet` is recommended to be used ``` If you create and persist a new entity in onFlush, then calling EntityManager#persist() is not enough. You have to execute an additional call to $unitOfWork->computeChangeSet($classMetadata, $entity). Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling $unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity). ``` So the method shouldn't be flag as internal: - To provide a BC-promise - To avoid psalm error with internal method
admin added the pull-request label 2026-01-22 16:09:39 +01:00
admin closed this issue 2026-01-22 16:09:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11082