Merge pull request #7423 from ThomasLandauer/patch-2
Update association-mapping.rst
This commit is contained in:
commit
2fc99afd44
@ -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")
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user