Skip to content

Link to inversedBy/mappedBy documentation #6849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions doctrine/associations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,25 @@ own a collection of its related ``Product`` objects.

.. note::

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

.. seealso::

To understand ``inversedBy`` and ``mappedBy`` usage, see Doctrine's
`Association Updates` documentation.

.. tip::

The targetEntity value in the metadata used above can reference any entity
with a valid namespace, not just entities defined in the same namespace. To
relate to an entity defined in a different class or bundle, enter a full
namespace as the targetEntity.
The targetEntity value in the metadata used above can reference any entity
with a valid namespace, not just entities defined in the same namespace. To
relate to an entity defined in a different class or bundle, enter a full
namespace as the targetEntity.

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

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