1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml

44 lines
943 B
YAML
Raw Normal View History

Doctrine\Tests\ORM\Mapping\User:
type: entity
table: cms_users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
name:
type: string
length: 50
nullable: true
unique: true
oneToOne:
address:
targetEntity: Address
joinColumn:
name: address_id
referencedColumnName: id
cascade: [ remove ]
oneToMany:
phonenumbers:
targetEntity: Phonenumber
mappedBy: user
cascade: [ persist ]
manyToMany:
groups:
targetEntity: Group
joinTable:
name: cms_users_groups
joinColumns:
user_id:
referencedColumnName: id
nullable: false
unique: false
inverseJoinColumns:
group_id:
referencedColumnName: id
cascade:
- all
lifecycleCallbacks:
doStuffOnPrePersist: prePersist
doStuffOnPostPersist: postPersist