1
0
mirror of synced 2025-02-09 00:39:25 +03:00

Update association-mapping.rst

Added info about owning and inverse side.
This commit is contained in:
Thomas Landauer 2018-10-09 21:33:42 +02:00 committed by GitHub
parent 7319f524a3
commit 892ef9edb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,8 +313,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
@ -335,7 +335,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;
@ -351,7 +351,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")
*/