Skip to content

Commit f48b30f

Browse files
MisterGlassweaverryan
authored andcommitted
Added a tip on relating to entities defined in other classes/bundles.
1 parent ee9fc39 commit f48b30f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

book/doctrine.rst

+7
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,13 @@ makes sense in the application for each ``Category`` to hold an array of
803803
added flexibility. If this makes you uncomfortable, don't worry. Just
804804
imagine that it's an ``array`` and you'll be in good shape.
805805

806+
.. tip::
807+
808+
The targetEntity value in the decorator used above can reference any entity
809+
with a valid namespace, not just entities defined in the same class. To
810+
relate to an entity defined in a differen't class or bundle, enter a full
811+
namespace or shortcut as the targetEntity.
812+
806813
Next, since each ``Product`` class can relate to exactly one ``Category``
807814
object, you'll want to add a ``$category`` property to the ``Product`` class::
808815

0 commit comments

Comments
 (0)