File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ Here is an example. You could setup a reference to the last 5 comments for blog
47
47
private $blogPost;
48
48
}
49
49
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:
52
51
53
52
.. code-block :: php
54
53
@@ -63,15 +62,15 @@ You can specify a ``mappedBy`` reference for one or many so if you wanted to you
63
62
*/
64
63
private $lastComment;
65
64
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:
68
67
69
68
.. code-block :: php
70
69
71
70
<?php
72
71
73
72
/**
74
- * @ReferenceOne (
73
+ * @ReferenceMany (
75
74
* targetDocument="Comment",
76
75
* mappedBy="blogPost",
77
76
* criteria={"isByAdmin" : true}
@@ -107,7 +106,7 @@ Now on the ``Comment`` class you would need to have a custom repository class co
107
106
// ...
108
107
}
109
108
110
- And in the ``CommentRepository `` we can define the ``findSomeComments() `` method:
109
+ And in the ``CommentRepository `` class we can define the ``findSomeComments() `` method:
111
110
112
111
.. code-block :: php
113
112
You can’t perform that action at this time.
0 commit comments