Tool for generating UML class diagram from Doctrine annotations

12.1k views Asked by At

I am looking for a tool that would generate an UML class diagram from Doctrine's @ORM annotations. Especially showing the relations between entities would be useful. Is there any such tool?

2

There are 2 answers

1
Ludek Vodicka On

Try ORM Designer. You can import annotations and get the visual model. This model can be exported to PDF or PNG file.

In addition you can also edit your schema files visually, and then continuously export your definitions back to your code.

This is how model looks like: Example of ORM Designer model

0
Ocramius On

This answer is framework-specific, but I'm working on adding support for this tool in doctrine/common, so if you are using symfony or CI or other frameworks, this may also be available soon.

If you are using Zend Framework 2.1 (as I'm writing) and follow my tutorial on installing Doctrine 2 ORM with ZF2, the developer toolbar will give you the ability to generate a diagram of all the entities with their relations, as of following picture:

UML diagram generated from Doctrine 2 ORM mappings via DoctrineModule

The tool is not yet perfect, but you may find it and help improve it in DoctrineORMModule.