--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
+ <!--<entity name="Rapsys\UserBundle\Entity\Civility" table="civilities">-->
+ <mapped-superclass name="Rapsys\UserBundle\Entity\Civility">
+ <id name="id" type="integer" column="id">
+ <generator strategy="AUTO" />
+ <options>
+ <option name="unsigned">true</option>
+ </options>
+ </id>
+ <field name="title" type="string" length="16" />
+ <field name="created" type="datetime" />
+ <field name="updated" type="datetime" />
+ <one-to-many field="users" target-entity="Rapsys\UserBundle\Entity\User" mapped-by="civility" fetch="LAZY"/>
+ <lifecycle-callbacks>
+ <lifecycle-callback type="preUpdate" method="preUpdate" />
+ </lifecycle-callbacks>
+ </mapped-superclass>
+</doctrine-mapping>
+++ /dev/null
-Rapsys\UserBundle\Entity\Civility:
- type: mappedSuperclass
-# table: civilities
- id:
- id:
- type: integer
- generator:
- strategy: AUTO
- options:
- unsigned: true
- fields:
- title:
- type: string
- length: 16
- created:
- type: datetime
- updated:
- type: datetime
-# oneToMany:
-# users:
-# targetEntity: User
-# mappedBy: title
- lifecycleCallbacks:
- preUpdate: ['preUpdate']
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
+ <mapped-superclass name="Rapsys\UserBundle\Entity\Group">
+ <id name="id" type="integer" column="id">
+ <generator strategy="AUTO" />
+ <options>
+ <option name="unsigned">true</option>
+ </options>
+ </id>
+ <field name="title" type="string" length="16" />
+ <field name="created" type="datetime" />
+ <field name="updated" type="datetime" />
+ <many-to-many field="users" target-entity="Rapsys\UserBundle\Entity\User" inversed-by="groups" fetch="LAZY" />
+ <lifecycle-callbacks>
+ <lifecycle-callback type="preUpdate" method="preUpdate" />
+ </lifecycle-callbacks>
+ </mapped-superclass>
+</doctrine-mapping>
+++ /dev/null
-Rapsys\UserBundle\Entity\Group:
- type: mappedSuperclass
-# table: groups
- id:
- id:
- type: integer
- generator:
- strategy: AUTO
- options:
- unsigned: true
- fields:
- title:
- type: string
- length: 16
- created:
- type: datetime
- updated:
- type: datetime
-# manyToMany:
-# users:
-# targetEntity: User
-# mappedBy: groups
- lifecycleCallbacks:
- preUpdate: ['preUpdate']
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
+ <mapped-superclass name="Rapsys\UserBundle\Entity\User" repository-class="Rapsys\UserBundle\Repository\UserRepository">
+ <id name="id" type="integer" column="id">
+ <generator strategy="AUTO" />
+ <options>
+ <option name="unsigned">true</option>
+ </options>
+ </id>
+ <field name="mail" type="string" length="254" unique="true" />
+ <field name="forename" type="string" length="32" nullable="true" />
+ <field name="surname" type="string" length="32" nullable="true" />
+ <field name="password" type="string" length="100" nullable="true" />
+ <field name="active" type="boolean">
+ <options>
+ <option name="default">true</option>
+ </options>
+ </field>
+ <field name="enable" type="boolean">
+ <options>
+ <option name="default">true</option>
+ </options>
+ </field>
+ <field name="created" type="datetime" />
+ <field name="updated" type="datetime" />
+ <many-to-one field="civility" target-entity="Rapsys\UserBundle\Entity\Civility" inversed-by="users" fetch="LAZY" />
+ <many-to-many field="groups" target-entity="Rapsys\UserBundle\Entity\Group" inversed-by="users" fetch="LAZY" />
+ <lifecycle-callbacks>
+ <lifecycle-callback type="preUpdate" method="preUpdate" />
+ </lifecycle-callbacks>
+ </mapped-superclass>
+</doctrine-mapping>
+++ /dev/null
-Rapsys\UserBundle\Entity\User:
- type: mappedSuperclass
- repositoryClass: Rapsys\UserBundle\Repository\UserRepository
-# table: users
- id:
- id:
- type: integer
- generator:
- strategy: AUTO
- options:
- unsigned: true
- fields:
- mail:
- type: string
- unique: true
- length: 254
- forename:
- type: string
- length: 32
- nullable: true
- surname:
- type: string
- length: 32
- nullable: true
- password:
- type: string
- length: 100
- active:
- type: boolean
- options:
- default: true
- enable:
- type: boolean
- options:
- default: true
- created:
- type: datetime
- updated:
- type: datetime
- manyToOne:
- civility:
- targetEntity: Civility
- inversedBy: users
- manyToMany:
- groups:
- targetEntity: Group
- inversedBy: users
-#see if usefull: https://stackoverflow.com/questions/34523699/how-to-extend-doctrine-entity-in-another-bundle
-# joinTable:
-# name: users_groups
-# joinColumns:
-# id:
-# name: user_id
-# inverseJoinColumns:
-# id:
-# name: group_id
- lifecycleCallbacks:
- preUpdate: ['preUpdate']