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?
In the Project tool window, right-click a package for which you want to create a diagram and select Diagrams | Show Diagram Ctrl+Alt+Shift+U ). In the list that opens, select Java Class Diagram. IntelliJ IDEA generates a UML diagram for classes and their dependencies.
To build a class diagram, all you have to do is launch the Smartdraw's Automatic Class Diagram extension and point it at your repository. Load your source code and choose which files you want to include in your diagram. Click "Build Diagram" and you're done.
IntelliJ IDEA Ultimate allows you to generate UML diagrams. You can use ⌥⇧⌘U (macOS) or Ctrl+Alt+Shift+U (Windows/Linux) to generate a UML diagram for your code which can help you and your team to read and understand the codebase.
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:
The tool is not yet perfect, but you may find it and help improve it in DoctrineORMModule.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With