Skip to content

Commit f89f380

Browse files
committed
Merge pull request #1575 from lucciano/patch-1
Update groups.md
2 parents 353216f + 9e5d620 commit f89f380

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Resources/doc/groups.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,29 @@ Acme\UserBundle\Entity\User:
236236
group_id:
237237
referencedColumnName: id
238238
```
239-
239+
```xml
240+
<?xml version="1.0" encoding="UTF-8"?>
241+
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
242+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
243+
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
244+
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
245+
<entity name="Acme\UserBundle\Entity\User" table="fos_user">
246+
<id name="id" column="id" type="integer">
247+
<generator strategy="AUTO" />
248+
</id>
249+
<many-to-many field="groups" target-entity="Group">
250+
<join-table name="fos_user_group">
251+
<join-columns>
252+
<join-column name="user_id" referenced-column-name="id"/>
253+
</join-columns>
254+
<inverse-join-columns>
255+
<join-column name="group_id" referenced-column-name="id" />
256+
</inverse-join-columns>
257+
</join-table>
258+
</many-to-many>
259+
</entity>
260+
</doctrine-mapping>
261+
```
240262
#### b) MongoDB User-Group mapping
241263

242264
``` php

0 commit comments

Comments
 (0)