From: Raphaƫl Gertz Date: Fri, 10 Nov 2023 12:30:56 +0000 (+0100) Subject: Add group, user and user translation doctrine orm config X-Git-Tag: 0.1~5 X-Git-Url: https://git.rapsys.eu/blogbundle/commitdiff_plain/c7ed862126a91df4a6b1a20dee52df633ba44a00 Add group, user and user translation doctrine orm config --- diff --git a/Resources/config/doctrine/Group.orm.yml b/Resources/config/doctrine/Group.orm.yml new file mode 100644 index 0000000..ef84ff0 --- /dev/null +++ b/Resources/config/doctrine/Group.orm.yml @@ -0,0 +1,8 @@ +Rapsys\BlogBundle\Entity\Group: + type: entity + #repositoryClass: Rapsys\BlogBundle\Repository\GroupRepository + table: groups + manyToMany: + users: + targetEntity: Rapsys\BlogBundle\Entity\User + mappedBy: groups diff --git a/Resources/config/doctrine/User.orm.yml b/Resources/config/doctrine/User.orm.yml new file mode 100644 index 0000000..913e32d --- /dev/null +++ b/Resources/config/doctrine/User.orm.yml @@ -0,0 +1,37 @@ +Rapsys\BlogBundle\Entity\User: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\UserRepository + table: users + fields: + pseudonym: + type: string + length: 64 + nullable: true + slug: + type: string + length: 64 + unique: true + nullable: true + oneToMany: + articles: + targetEntity: Rapsys\BlogBundle\Entity\Article + mappedBy: user + user_translations: + targetEntity: Rapsys\BlogBundle\Entity\UserTranslation + mappedBy: user +# manyToMany: +# groups: +# targetEntity: Group +# inversedBy: users +# joinTable: +# name: users_groups + associationOverride: + groups: + joinTable: + name: users_groups + joinColumns: + id: + name: user_id + inverseJoinColumns: + id: + name: group_id diff --git a/Resources/config/doctrine/UserTranslation.orm.yml b/Resources/config/doctrine/UserTranslation.orm.yml new file mode 100644 index 0000000..c074499 --- /dev/null +++ b/Resources/config/doctrine/UserTranslation.orm.yml @@ -0,0 +1,28 @@ +Rapsys\BlogBundle\Entity\UserTranslation: + type: entity + #repositoryClass: Rapsys\BlogBundle\Repository\UserTranslationRepository + table: users_translations + id: + user_id: + type: integer + options: + unsigned: true + locale: + type: string + length: 5 + fields: + description: + type: text + nullable: true + created: + type: datetime + updated: + type: datetime + manyToOne: + user: + targetEntity: Rapsys\BlogBundle\Entity\User + inversedBy: user_translations + joinColumn: + nullable: false + lifecycleCallbacks: + preUpdate: ['preUpdate']