1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Fixed grammatical errors in working-with-associations.rst

This commit is contained in:
Dan Patrick 2011-07-30 17:15:44 -05:00
parent 3a70ee6662
commit bfe5bea68d

View File

@ -246,8 +246,8 @@ the database permanently.
Notice how both sides of the bidirectional association are always Notice how both sides of the bidirectional association are always
updated. Unidirectional associations are consequently simpler to updated. Unidirectional associations are consequently simpler to
handle. Also note that if you type-hint your methods, i.e. handle. Also note that if you use type-hinting in your methods, i.e.
``setAddress(Address $address)``, then PHP does only allows null ``setAddress(Address $address)``, PHP will only allow null
values if ``null`` is set as default value. Otherwise values if ``null`` is set as default value. Otherwise
setAddress(null) will fail for removing the association. If you setAddress(null) will fail for removing the association. If you
insist on type-hinting a typical way to deal with this is to insist on type-hinting a typical way to deal with this is to
@ -279,8 +279,9 @@ entities that have been re-added to the collection.
Say you clear a collection of tags by calling Say you clear a collection of tags by calling
``$post->getTags()->clear();`` and then call ``$post->getTags()->clear();`` and then call
``$post->getTags()->add($tag)``. This will not recognize tag being ``$post->getTags()->add($tag)``. This will not recognize the tag having
already added before and issue two database calls. already been added previously and will consequently issue two separate database
calls.
Association Management Methods Association Management Methods
------------------------------ ------------------------------
@ -380,9 +381,9 @@ as your preferences.
Synchronizing Bidirectional Collections Synchronizing Bidirectional Collections
--------------------------------------- ---------------------------------------
In the case of Many-To-Many associations you as the developer are In the case of Many-To-Many associations you as the developer have the
responsible to keep the collections on the owning and inverse side responsibility of keeping the collections on the owning and inverse side
up in sync, when you apply changes to them. Doctrine can only in sync when you apply changes to them. Doctrine can only
guarantee a consistent state for the hydration, not for your client guarantee a consistent state for the hydration, not for your client
code. code.
@ -468,7 +469,7 @@ code would fail if you removed the call to
cascade the persist operation to all nested entities that are new cascade the persist operation to all nested entities that are new
as well. as well.
More complicated is the deletion of all a users comments when he is More complicated is the deletion of all of a user's comments when he is
removed from the system: removed from the system:
.. code-block:: php .. code-block:: php
@ -590,7 +591,7 @@ and StandingData:
} }
} }
Now two examples what happens when you remove the references: Now two examples of what happens when you remove the references:
.. code-block:: php .. code-block:: php
@ -602,7 +603,8 @@ Now two examples what happens when you remove the references:
$em->flush(); $em->flush();
In this case you have only changed the ``Contact`` entity but you removed In this case you have not only changed the ``Contact`` entity itself but
the references for standing data and one address reference. When flush is called you have also removed the references for standing data and as well as one
not only are the references removed but both the old standing data and the one address reference. When flush is called not only are the references removed
address entity are also deleted from the database. but both the old standing data and the one address entity are also deleted
from the database.