From: Raphaƫl Gertz Date: Sun, 25 Feb 2018 05:22:08 +0000 (+0100) Subject: Add doctrine configuration X-Git-Tag: 0.1~55 X-Git-Url: https://git.rapsys.eu/blogbundle/commitdiff_plain/97215da101c2bd6c0ba7fc0beb45a2bb045220dd?ds=sidebyside;hp=7ab0c56bbb9c228d9b6b24cdee90c1fa73570a6a Add doctrine configuration --- diff --git a/Resources/config/doctrine/Article.orm.yml b/Resources/config/doctrine/Article.orm.yml new file mode 100644 index 0000000..bb32b84 --- /dev/null +++ b/Resources/config/doctrine/Article.orm.yml @@ -0,0 +1,33 @@ +Rapsys\BlogBundle\Entity\Article: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\ArticleRepository + table: articles + id: + id: + type: integer + generator: + strategy: AUTO + options: + unsigned: true + fields: + created: + type: datetime + updated: + type: datetime + manyToOne: + site: + targetEntity: Rapsys\BlogBundle\Entity\Site + inversedBy: articles + author: + targetEntity: Rapsys\BlogBundle\Entity\Author + inversedBy: articles + manyToMany: + keywords: + targetEntity: Rapsys\BlogBundle\Entity\Keyword + inversedBy: articles + joinTable: + name: articles_keywords + oneToMany: + article_translations: + targetEntity: Rapsys\BlogBundle\Entity\ArticleTranslation + mappedBy: article diff --git a/Resources/config/doctrine/ArticleKeyword.orm.yml b/Resources/config/doctrine/ArticleKeyword.orm.yml new file mode 100644 index 0000000..5a396c4 --- /dev/null +++ b/Resources/config/doctrine/ArticleKeyword.orm.yml @@ -0,0 +1,12 @@ +Rapsys\BlogBundle\Entity\ArticleKeyword: + type: entity + table: articles_keywords + id: + article_id: + type: integer + options: + unsigned: true + keyword_id: + type: integer + options: + unsigned: true diff --git a/Resources/config/doctrine/ArticleTranslation.orm.yml b/Resources/config/doctrine/ArticleTranslation.orm.yml new file mode 100644 index 0000000..5c581bf --- /dev/null +++ b/Resources/config/doctrine/ArticleTranslation.orm.yml @@ -0,0 +1,38 @@ +Rapsys\BlogBundle\Entity\ArticleTranslation: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\ArticleTranslationRepository + table: articles_translations + id: + article_id: + type: integer + options: + unsigned: true + language_id: + type: smallint + options: + unsigned: true + fields: + slug: + type: string + length: 128 + title: + type: string + length: 128 + description: + type: text + body: + type: text + created: + type: datetime + updated: + type: datetime + manyToOne: + article: + targetEntity: Rapsys\BlogBundle\Entity\Article + inversedBy: article_translations + language: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: article_translations + uniqueConstraints: + slug_language: + columns: [ slug, language_id ] diff --git a/Resources/config/doctrine/Author.orm.yml b/Resources/config/doctrine/Author.orm.yml new file mode 100644 index 0000000..176fe32 --- /dev/null +++ b/Resources/config/doctrine/Author.orm.yml @@ -0,0 +1,33 @@ +Rapsys\BlogBundle\Entity\Author: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\AuthorRepository + table: authors + indexes: + name: + columns: [ name ] + id: + id: + type: smallint + generator: + strategy: AUTO + options: + unsigned: true + fields: + name: + type: string + length: 64 + slug: + type: string + length: 64 + unique: true + created: + type: datetime + updated: + type: datetime + oneToMany: + articles: + targetEntity: Rapsys\BlogBundle\Entity\Article + mappedBy: author + author_translations: + targetEntity: Rapsys\BlogBundle\Entity\AuthorTranslation + mappedBy: author diff --git a/Resources/config/doctrine/AuthorTranslation.orm.yml b/Resources/config/doctrine/AuthorTranslation.orm.yml new file mode 100644 index 0000000..b7be2e3 --- /dev/null +++ b/Resources/config/doctrine/AuthorTranslation.orm.yml @@ -0,0 +1,27 @@ +Rapsys\BlogBundle\Entity\AuthorTranslation: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\AuthorTranslationRepository + table: authors_translations + id: + author_id: + type: smallint + options: + unsigned: true + language_id: + type: smallint + options: + unsigned: true + fields: + description: + type: text + created: + type: datetime + updated: + type: datetime + manyToOne: + author: + targetEntity: Rapsys\BlogBundle\Entity\Author + inversedBy: author_translations + language: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: language_translations diff --git a/Resources/config/doctrine/Keyword.orm.yml b/Resources/config/doctrine/Keyword.orm.yml new file mode 100644 index 0000000..3935bf8 --- /dev/null +++ b/Resources/config/doctrine/Keyword.orm.yml @@ -0,0 +1,24 @@ +Rapsys\BlogBundle\Entity\Keyword: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\KeywordRepository + table: keywords + id: + id: + type: integer + generator: + strategy: AUTO + options: + unsigned: true + fields: + created: + type: datetime + updated: + type: datetime + manyToMany: + articles: + targetEntity: Rapsys\BlogBundle\Entity\Article + mappedBy: keywords + oneToMany: + keyword_translations: + targetEntity: Rapsys\BlogBundle\Entity\KeywordTranslation + mappedBy: keyword diff --git a/Resources/config/doctrine/KeywordTranslation.orm.yml b/Resources/config/doctrine/KeywordTranslation.orm.yml new file mode 100644 index 0000000..0ba4b8b --- /dev/null +++ b/Resources/config/doctrine/KeywordTranslation.orm.yml @@ -0,0 +1,36 @@ +Rapsys\BlogBundle\Entity\KeywordTranslation: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\KeywordTranslationRepository + table: keywords_translations + id: + keyword_id: + type: integer + options: + unsigned: true + language_id: + type: smallint + options: + unsigned: true + fields: + slug: + type: string + length: 128 + title: + type: string + length: 128 + description: + type: text + created: + type: datetime + updated: + type: datetime + manyToOne: + keyword: + targetEntity: Rapsys\BlogBundle\Entity\Keyword + inversedBy: keyword_translations + language: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: keyword_translations + uniqueConstraints: + slug_language: + columns: [ slug, language_id ] diff --git a/Resources/config/doctrine/Language.orm.yml b/Resources/config/doctrine/Language.orm.yml new file mode 100644 index 0000000..9099e65 --- /dev/null +++ b/Resources/config/doctrine/Language.orm.yml @@ -0,0 +1,43 @@ +Rapsys\BlogBundle\Entity\Language: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\LanguageRepository + table: languages + indexes: + iso6391: + columns: [ iso6391 ] + iso6393: + columns: [ iso6393 ] + id: + id: + type: smallint + generator: + strategy: AUTO + options: + unsigned: true + fields: + iso6391: + type: string + length: 2 + iso6393: + type: string + length: 3 + created: + type: datetime + updated: + type: datetime + oneToMany: + article_translations: + targetEntity: Rapsys\BlogBundle\Entity\ArticleTranslation + mappedBy: language + keyword_translations: + targetEntity: Rapsys\BlogBundle\Entity\KeywordTranslation + mappedBy: language + site_translations: + targetEntity: Rapsys\BlogBundle\Entity\SiteTranslation + mappedBy: language + language_translations: + targetEntity: Rapsys\BlogBundle\Entity\LanguageTranslation + mappedBy: language + target_translations: + targetEntity: Rapsys\BlogBundle\Entity\LanguageTranslation + mappedBy: target diff --git a/Resources/config/doctrine/LanguageTranslation.orm.yml b/Resources/config/doctrine/LanguageTranslation.orm.yml new file mode 100644 index 0000000..572e553 --- /dev/null +++ b/Resources/config/doctrine/LanguageTranslation.orm.yml @@ -0,0 +1,28 @@ +Rapsys\BlogBundle\Entity\LanguageTranslation: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\LanguageTranslationRepository + table: languages_translations + id: + language_id: + type: smallint + options: + unsigned: true + target_id: + type: smallint + options: + unsigned: true + fields: + title: + type: string + length: 128 + created: + type: datetime + updated: + type: datetime + manyToOne: + language: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: language_translations + target: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: target_translations diff --git a/Resources/config/doctrine/Site.orm.yml b/Resources/config/doctrine/Site.orm.yml new file mode 100644 index 0000000..4719624 --- /dev/null +++ b/Resources/config/doctrine/Site.orm.yml @@ -0,0 +1,29 @@ +Rapsys\BlogBundle\Entity\Site: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\SiteRepository + table: sites + indexes: + domain: + columns: [ domain ] + id: + id: + type: smallint + generator: + strategy: AUTO + options: + unsigned: true + fields: + domain: + type: string + length: 64 + created: + type: datetime + updated: + type: datetime + oneToMany: + articles: + targetEntity: Rapsys\BlogBundle\Entity\Article + mappedBy: site + site_translations: + targetEntity: Rapsys\BlogBundle\Entity\SiteTranslation + mappedBy: site diff --git a/Resources/config/doctrine/SiteTranslation.orm.yml b/Resources/config/doctrine/SiteTranslation.orm.yml new file mode 100644 index 0000000..2821393 --- /dev/null +++ b/Resources/config/doctrine/SiteTranslation.orm.yml @@ -0,0 +1,30 @@ +Rapsys\BlogBundle\Entity\SiteTranslation: + type: entity + repositoryClass: Rapsys\BlogBundle\Repository\SiteTranslationRepository + table: sites_translations + id: + site_id: + type: smallint + options: + unsigned: true + language_id: + type: smallint + options: + unsigned: true + fields: + title: + type: string + length: 128 + description: + type: text + created: + type: datetime + updated: + type: datetime + manyToOne: + site: + targetEntity: Rapsys\BlogBundle\Entity\Site + inversedBy: site_translations + language: + targetEntity: Rapsys\BlogBundle\Entity\Language + inversedBy: site_translations