johmue/mysql-workbench-schema-exporter — pull request #69 by rvock (2012-08-11 15:48:06+00:00)
Title: Optimized Doctrine2 Annotations

This pull-request consists of some commits, enhancing the Doctrine2 Annotation exporter.

I've added an option (`useTabs`) to use tabs instead of spaces for indentation. When this option is set, the `indentation` is ignored.

Comments for tables and columns are written to the PHP-file.

Fields for relations are not written to the class any more. If you've got two classes, articles and tags, and the tags have a relation to the articles, I think it's better to use the `setArticle()` method than to have the `setArticleId` inside the Tag-entity.

Similar to this feature, I am no longer generating entities for many-to-many mapping tables. As far as I understand Doctrine2, you do not need an extra entity for these tables. Just use the add*-method of entities belonging to the m2m-relation.

The rest of the commits add features or options that you can set using the comments on tables or foreign keys in MySQL Workbench. These features are explained in the Readme.md. Most of them add options to the relation-Annotations like cascade, fetch and orphanRemoval.

But there is also a comment for tables to mark them, if they were incorrectly regarded as m2m-mapping tables. It is also possible to make relations uni-directional, if you want to keep your models cleaner.

I hope you like the changes :-)