2017 © Pedro Peláez
 

library doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

image

mysql-workbench-schema-exporter/doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

  • Tuesday, April 10, 2018
  • by rvock
  • Repository
  • 7 Watchers
  • 9 Stars
  • 29,437 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 14 Forks
  • 8 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Build Status Latest Stable Version Total Downloads License, (*1)

README

This is an exporter to convert MySQL Workbench Models (*.mwb) to a Doctrine 2 Schema., (*2)

Prerequisites

  • PHP 7.2+
  • Composer to install the dependencies

Installation

composer require --dev mysql-workbench-schema-exporter/doctrine2-exporter

This will install the exporter and also require mysql-workbench-schema-exporter., (*3)

You then can invoke the CLI script using vendor/bin/mysql-workbench-schema-export., (*4)

Configuration

Model Comment Behavior

  • {d:bundleNamespace}AcmeBundle{/d:bundleNamespace} (applied to Table), (*5)

    Override bundleNamespace option., (*6)

  • {d:m2m}false{/d:m2m} (applied to Table), (*7)

    MySQL Workbench Schema Exporter tries to automatically guess which tables are many-to-many mapping tables and will not generate entity classes for these tables., (*8)

    A table is considered a mapping table, if it contains exactly two foreign keys to different tables and those tables are not many-to-many mapping tables., (*9)

    Sometimes this guessing is incorrect for you. But you can add a hint in the comment of the table, to show that it is no mapping table. Just use {d:m2m}false{/d:m2m} anywhere in the comment of the table., (*10)

  • {d:unidirectional}true{/d:unidirectional} (applied to ForeignKey), (*11)

    All foreign keys will result in a bidirectional relation by default. If you only want a unidirectional relation, add a flag to the comment of the foreign key., (*12)

  • {d:owningSide}true{/d:owningSide} (applied to ForeignKey), (*13)

    In a bi-directional many-to-many mapping table the owning side of the relation is randomly selected. If you add this hint to one foreign key of the m2m-table, you can define the owning side for Doctrine., (*14)

  • {d:cascade}persist, merge, remove, detach, all{/d:cascade} (applied to ForeignKey), (*15)

    You can specify Doctrine cascade options as a comment on a foreign key. They will be generated into the Annotation. (Reference), (*16)

  • {d:fetch}EAGER{/d:fetch} (applied to ForeignKey), (*17)

    You can specify the fetch type for relations in the comment of a foreign key. (EAGER or LAZY, doctrine default is LAZY), (*18)

  • {d:orphanRemoval}true{/d:orphanRemoval} (applied to ForeignKey), (*19)

    Another option you can set in the comments of foreign key. (Reference), (*20)

  • {d:order}column{/d:order} (applied to ForeignKey), (*21)

    Apply OrderBy annotation to One To Many and Many To Many relation. OrderBy annotation can be written in the following format:, (*22)

    column[,(asc|desc)]

    Multiple columns are supported, separated by line break. Example usage:, (*23)

    {d:order}
      column1
      column1,desc
    {/d:order}
  • {d:cache}READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE{/d:cache} (applied to Table and/or ForeignKey), (*24)

    You can specify Doctrine second level caching strategy as a comment on a table or foreign key. They will be generated into the Annotation or YAML. (Reference), (*25)

  • {d:relatedNames}RelationTable:NewName{/d:relatedNames} (applied to Table), (*26)

    Overrides relatedVarNameFormat., (*27)

    Rename generated related column names when the table names and the relatedVarNameFormat pattern are not good enough. The format should be CamelCase singular and should map with the class name that is generated for the related entity. Can be written in the following format:, (*28)

    RelationTableName:CustomRelationName

    Multiple relations are supported, separated by line break. Example usage: - on a "store_products" table with "store_product_categories" and "store_product_images" related tables:, (*29)

    {d:relatedNames}
    StoreProductCategory:Category
    StoreProductImage:Image
    {/d:relatedNames}

    It can be used in both parent / child tables. For example, on a "store_product_images" table:, (*30)

    {d:relatedNames}
    StoreProduct:Product
    {/d:relatedNames}

    The generated StoreProduct class will have "category" and "image" properties instead of "storeProductCategory" and "storeProductImage", while the "StoreProductImage" class will have a "product" property instead of "storeProduct"., (*31)

Command Line Interface (CLI)

See documentation for mysql-workbench-schema-exporter, (*32)

The Versions

10/04 2018

dev-master

9999999-dev https://github.com/mysql-workbench-schema-exporter/doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

  Sources   Download

MIT

The Requires

 

by Johannes Mueller
by Toha
by Robert Vock

database cli doctrine mysql mysql workbench

17/01 2017

3.0.1

3.0.1.0 https://github.com/mysql-workbench-schema-exporter/doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

  Sources   Download

MIT

The Requires

 

by Johannes Mueller
by Toha
by Robert Vock

database cli doctrine mysql mysql workbench

04/01 2016

3.0.0

3.0.0.0 https://github.com/mysql-workbench-schema-exporter/doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

  Sources   Download

MIT

The Requires

 

by Johannes Mueller
by Toha
by Robert Vock

database cli doctrine mysql mysql workbench