]> Raphaël G. Git Repositories - userbundle/commitdiff
Move now unsuported yml entities definition to xml format
authorRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:40:57 +0000 (16:40 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:40:57 +0000 (16:40 +0100)
config/doctrine/Civility.orm.xml [new file with mode: 0644]
config/doctrine/Civility.orm.yml [deleted file]
config/doctrine/Group.orm.xml [new file with mode: 0644]
config/doctrine/Group.orm.yml [deleted file]
config/doctrine/User.orm.xml [new file with mode: 0644]
config/doctrine/User.orm.yml [deleted file]

diff --git a/config/doctrine/Civility.orm.xml b/config/doctrine/Civility.orm.xml
new file mode 100644 (file)
index 0000000..6cbd3d9
--- /dev/null
@@ -0,0 +1,19 @@
+<?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>
diff --git a/config/doctrine/Civility.orm.yml b/config/doctrine/Civility.orm.yml
deleted file mode 100644 (file)
index cce2efe..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-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']
diff --git a/config/doctrine/Group.orm.xml b/config/doctrine/Group.orm.xml
new file mode 100644 (file)
index 0000000..441ad52
--- /dev/null
@@ -0,0 +1,18 @@
+<?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>
diff --git a/config/doctrine/Group.orm.yml b/config/doctrine/Group.orm.yml
deleted file mode 100644 (file)
index d05124f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-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']
diff --git a/config/doctrine/User.orm.xml b/config/doctrine/User.orm.xml
new file mode 100644 (file)
index 0000000..7f83696
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>
diff --git a/config/doctrine/User.orm.yml b/config/doctrine/User.orm.yml
deleted file mode 100644 (file)
index 829fddb..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-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']