computeChangeSet is an internal function, but documentation tells to use it in listeners #5194

Closed
opened 2026-01-22 15:01:19 +01:00 by admin · 3 comments
Owner

Originally created by @ctx2002 on GitHub (Jul 20, 2016).

Originally assigned to: @Ocramius on GitHub.

http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/events.html#onflush

"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)."

in source code, it says computeChangeSet is an internal function, but above documentation tells reader should use "computeChangeSet " function.

Originally created by @ctx2002 on GitHub (Jul 20, 2016). Originally assigned to: @Ocramius on GitHub. http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/events.html#onflush "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)." in source code, it says computeChangeSet is an internal function, but above documentation tells reader should use "computeChangeSet " function.
admin added the Can't FixDocumentation labels 2026-01-22 15:01:19 +01:00
admin closed this issue 2026-01-22 15:01:21 +01:00
Author
Owner

@Ocramius commented on GitHub (Jul 20, 2016):

Whenever you deal with event listeners, you are already working with ORM internals, so everything is pretty much "at your own risk".

We don't guarantee that the API will exist in ORM v3, but you can use it as long as you carefully integration-test the functionality of your listeners.

Consider editing https://github.com/doctrine/doctrine2/blob/master/docs/en/reference/events.rst to clarify it, should you have suggestions on how to improve the wording.

@Ocramius commented on GitHub (Jul 20, 2016): Whenever you deal with event listeners, you are already working with ORM internals, so everything is pretty much "at your own risk". We don't guarantee that the API will exist in ORM v3, but you can use it as long as you carefully integration-test the functionality of your listeners. Consider editing https://github.com/doctrine/doctrine2/blob/master/docs/en/reference/events.rst to clarify it, should you have suggestions on how to improve the wording.
Author
Owner

@Mouradif commented on GitHub (Dec 14, 2018):

The link to readthedocs.io is dead

@Mouradif commented on GitHub (Dec 14, 2018): The link to readthedocs.io is dead
Author
Owner

@Ocramius commented on GitHub (Dec 14, 2018):

Closing this one as "can't fix".

It is indeed an internal function, but no real way to make a more stable API about it for now.

@Ocramius commented on GitHub (Dec 14, 2018): Closing this one as "can't fix". It is indeed an internal function, but no real way to make a more stable API about it for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5194