Code Generation etc.

You can still use Doctrine stuff if you want!

If you are already familiar with Doctrine and like to use code generation to create entities and databases, and Doctrine Migrations to track changes to your database, you can continue to use those tools with Objectiphy. Objectiphy currently does not integrate with Symfony's maker bundle or offer any other code generation or database migration features, but due to its compatibility with Doctrine entities, you can continue to use Doctrine for those things, and just use Objectiphy as an ORM. However, Doctrine's code generation will not know how to create Objectiphy repository classes, so you can only really use it to create entities.

If you are not familiar with how code generation is used in Doctrine, check out the maker bundle from the Symfony project. It uses a command line tool to prompt you for information about your object model, then generates entities and custom repository classes for you, and you can even generate your database tables and columns with all the foreign keys and mapping information set up for you. This does require that you be somewhat familiar with some of the terminology used by Doctrine, but can be a time saver.

For new users, or those unfamiliar with Doctrine, I would recommend building your database tables and creating your entities manually yourself. It really doesn't take that much longer, and you will have a better understanding of how everything fits together.

For an enterprise project where changes to your database need to be tracked and source controlled, Doctrine migrations can be very helpful. Again, you can use that alongside Objectiphy, but you don't have to - you can implement your own change tracking mechanism for your database.

Last updated