1
0
mirror of synced 2025-02-20 22:23:14 +03:00

Enhanced docs on UnitOfWork#computeChangeSets

This commit is contained in:
Benjamin Eberlei 2011-10-15 18:09:27 +02:00
parent 6d4337fc71
commit 237c20c9b6

View File

@ -471,16 +471,14 @@ mentioned sets. See this example:
The following restrictions apply to the onFlush event:
- Calling ``EntityManager#persist()`` does not suffice to trigger
a persist on an entity. You have to execute an additional call to
- 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 either calling
``$unitOfWork->computeChangeSet($classMetadata, $entity)`` or
``$unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity)``.
The second method has lower overhead, but only re-computes
primitive fields, never associations.
preUpdate
~~~~~~~~~