Merge pull request #575 from naitsirch/master
Added YAML configuration example for "Simple Derived Identity" in Docs
This commit is contained in:
commit
e86419cfa5
@ -239,6 +239,8 @@ Sometimes you have the requirement that two objects are related by a One-To-One
|
|||||||
and that the dependent class should re-use the primary key of the class it depends on.
|
and that the dependent class should re-use the primary key of the class it depends on.
|
||||||
One good example for this is a user-address relationship:
|
One good example for this is a user-address relationship:
|
||||||
|
|
||||||
|
.. configuration-block::
|
||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -260,6 +262,26 @@ One good example for this is a user-address relationship:
|
|||||||
private $user;
|
private $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
User:
|
||||||
|
type: entity
|
||||||
|
id:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
generator:
|
||||||
|
strategy: AUTO
|
||||||
|
|
||||||
|
Address:
|
||||||
|
type: entity
|
||||||
|
id:
|
||||||
|
user:
|
||||||
|
associationKey: true
|
||||||
|
oneToOne:
|
||||||
|
user:
|
||||||
|
targetEntity: User
|
||||||
|
|
||||||
|
|
||||||
Use-Case 3: Join-Table with Metadata
|
Use-Case 3: Join-Table with Metadata
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user