Skip to content

Commit 1a36e08

Browse files
committed
minor #6849 Link to inversedBy/mappedBy documentation (soulchainer, wouterj)
This PR was merged into the 2.7 branch. Discussion ---------- Link to inversedBy/mappedBy documentation Finishes #6769 Original description: > Note for «see doctrine's documentation» just in section where `inversedBy` and `mappedBy` first appeared > I know that five sections away there is a [More Information on Associations](https://symfony.com/doc/2.7/book/doctrine.html#more-information-on-associations) section, that has a reference to this (if you dig enough: it's linked in the page linked in that section), but that's not enough. It's too general and too late. > When you're reading this (my case, as a newcomer right now) and get to this `inversedBy` and `mappedBy` in [Relationship Mapping Metadata](https://symfony.com/doc/2.7/book/doctrine.html#relationship-mapping-metadata) section, and there isn't any direct mention about it, you felt lost. Can't understand why that's used and what it means. And you scroll and see no direct reference about that. It breaks your learning rhythm. I had to search about this, till I found the Doctrine's documentation that I linked in the added note. That cleared out the doubt. So I can continue learning. Five sections away there's a general «Read more about associations». That's OK. I will read more then. But at that moment, you need, at least, to understand why that parameters are there. Commits ------- e33b7f3 Minor unrelated spacing fixes af3adb8 Update doctrine.rst
2 parents 75d6c1c + e33b7f3 commit 1a36e08

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

doctrine/associations.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,25 @@ own a collection of its related ``Product`` objects.
168168

169169
.. note::
170170

171-
The code in the constructor is important. Rather than being instantiated
171+
The code in the constructor is important. Rather than being instantiated
172172
as a traditional ``array``, the ``$products`` property must be of a type
173173
that implements Doctrine's ``Collection`` interface. In this case, an
174174
``ArrayCollection`` object is used. This object looks and acts almost
175175
*exactly* like an array, but has some added flexibility. If this makes
176176
you uncomfortable, don't worry. Just imagine that it's an ``array``
177177
and you'll be in good shape.
178178

179+
.. seealso::
180+
181+
To understand ``inversedBy`` and ``mappedBy`` usage, see Doctrine's
182+
`Association Updates` documentation.
183+
179184
.. tip::
180185

181-
The targetEntity value in the metadata used above can reference any entity
182-
with a valid namespace, not just entities defined in the same namespace. To
183-
relate to an entity defined in a different class or bundle, enter a full
184-
namespace as the targetEntity.
186+
The targetEntity value in the metadata used above can reference any entity
187+
with a valid namespace, not just entities defined in the same namespace. To
188+
relate to an entity defined in a different class or bundle, enter a full
189+
namespace as the targetEntity.
185190

186191
Now that you've added new properties to both the ``Product`` and ``Category``
187192
classes, tell Doctrine to generate the missing getter and setter methods for you:
@@ -407,3 +412,4 @@ Doctrine's `Association Mapping Documentation`_.
407412
statement, which *imports* the ``ORM`` annotations prefix.
408413

409414
.. _`Association Mapping Documentation`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html
415+
.. _`Association Updates`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html

0 commit comments

Comments
 (0)