Skip to content

Commit 546a40b

Browse files
committed
Incorrect cardinality on the Complex References "admin comments" example.
- Cardinality is ReferenceMany, not ReferenceOne. - small wording changes for clarity.
1 parent d1b7d34 commit 546a40b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/en/reference/complex-references.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ Here is an example. You could setup a reference to the last 5 comments for blog
4747
private $blogPost;
4848
}
4949
50-
You can specify a ``mappedBy`` reference for one or many so if you wanted to you could have even a
51-
``$lastComment`` reference on the ``BlogPost``:
50+
You can also use ``mappedBy`` for referencing a single document, as in the following example:
5251

5352
.. code-block:: php
5453
@@ -63,15 +62,15 @@ You can specify a ``mappedBy`` reference for one or many so if you wanted to you
6362
*/
6463
private $lastComment;
6564
66-
Use an array of criteria to limit a references documents. Here we have a reference in ``$commentsByAdmin``
67-
to the comments that are by administrators:
65+
Use an array of criteria to limit referenced documents. In the following example,
66+
``$commentsByAdmin`` will refer to comments created by administrators:
6867

6968
.. code-block:: php
7069
7170
<?php
7271
7372
/**
74-
* @ReferenceOne(
73+
* @ReferenceMany(
7574
* targetDocument="Comment",
7675
* mappedBy="blogPost",
7776
* criteria={"isByAdmin" : true}
@@ -107,7 +106,7 @@ Now on the ``Comment`` class you would need to have a custom repository class co
107106
// ...
108107
}
109108
110-
And in the ``CommentRepository`` we can define the ``findSomeComments()`` method:
109+
And in the ``CommentRepository`` class we can define the ``findSomeComments()`` method:
111110

112111
.. code-block:: php
113112

0 commit comments

Comments
 (0)