1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Merge pull request #7423 from ThomasLandauer/patch-2

Update association-mapping.rst
This commit is contained in:
Michael Moravec 2018-11-10 20:40:44 +01:00 committed by GitHub
commit 2fc99afd44
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 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 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 the foreign key, making it the owning side. Doctrine needs the "many" side
defined in order to understand the association. defined in order to understand the association.
This bidirectional mapping requires the ``mappedBy`` attribute on the 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") * @OneToMany(targetEntity="Feature", mappedBy="product")
*/ */
private $features; 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") * @ManyToOne(targetEntity="Product", inversedBy="features")
* @JoinColumn(name="product_id", referencedColumnName="id") * @JoinColumn(name="product_id", referencedColumnName="id")
*/ */