Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Mapping / yaml / Doctrine.Tests.ORM.Mapping.User.dcm.yml
1 Doctrine\Tests\ORM\Mapping\User:
2   type: entity
3   table: cms_users
4   options:
5     foo: bar
6     baz:
7       key: val
8   namedQueries:
9     all: SELECT u FROM __CLASS__ u
10   id:
11     id:
12       type: integer
13       generator:
14         strategy: AUTO
15       sequenceGenerator:
16         sequenceName: tablename_seq
17         allocationSize: 100
18         initialValue: 1
19   fields:
20     name:
21       type: string
22       length: 50
23       nullable: true
24       unique: true
25       options:
26         foo: bar
27         baz:
28           key: val
29     email:
30       type: string
31       column: user_email
32       columnDefinition: CHAR(32) NOT NULL
33   oneToOne:
34     address:
35       targetEntity: Address
36       inversedBy: user
37       joinColumn:
38         name: address_id
39         referencedColumnName: id
40         onDelete: CASCADE
41       cascade: [ remove ]
42   oneToMany:
43     phonenumbers:
44       targetEntity: Phonenumber
45       orphanRemoval: true
46       mappedBy: user
47       orderBy:
48         number: ASC
49       cascade: [ persist ]
50   manyToMany:
51     groups:
52       targetEntity: Group
53       joinTable:
54         name: cms_users_groups
55         joinColumns:
56           user_id:
57             referencedColumnName: id
58             nullable: false
59             unique: false
60         inverseJoinColumns:
61           group_id:
62             referencedColumnName: id
63             columnDefinition: INT NULL
64       cascade:
65         - all
66   lifecycleCallbacks:
67     prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] 
68     postPersist: [ doStuffOnPostPersist ]
69   uniqueConstraints:
70     search_idx:
71       columns: name,user_email
72   indexes:
73     name_idx:
74       columns: name
75     0:
76       columns: user_email