mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
computeChangeSet is an internal function, but documentation tells to use it in listeners
#5194
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 @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.
@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.
@Mouradif commented on GitHub (Dec 14, 2018):
The link to readthedocs.io is dead
@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.