Skip to content

Commit

Permalink
Update association-mapping.rst
Browse files Browse the repository at this point in the history
Added info about owning and inverse side.
  • Loading branch information
ThomasLandauer authored and Majkl578 committed Nov 10, 2018
1 parent 8a79638 commit d0b47f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/en/reference/association-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ One-To-Many, Bidirectional
--------------------------

A one-to-many association has to be bidirectional, unless you are using a
join table. This is because the many side in a one-to-many association holds
the foreign key, making it the owning side. Doctrine needs the many side
join table. This is because the "many" side in a one-to-many association holds
the foreign key, making it the owning side. Doctrine needs the "many" side
defined in order to understand the association.

This bidirectional mapping requires the ``mappedBy`` attribute on the
Expand All @@ -297,7 +297,7 @@ bidirectional many-to-one.
{
// ...
/**
* One Product has Many Features.
* One product has many features. This is the inverse side.
* @OneToMany(targetEntity="Feature", mappedBy="product")
*/
private $features;
Expand All @@ -313,7 +313,7 @@ bidirectional many-to-one.
{
// ...
/**
* Many Features have One Product.
* Many features have one product. This is the owning side.
* @ManyToOne(targetEntity="Product", inversedBy="features")
* @JoinColumn(name="product_id", referencedColumnName="id")
*/
Expand Down

0 comments on commit d0b47f3

Please sign in to comment.