What is a DAL Doctrine Alternative for symfony2

I really like when symfony 2 is headed, I just don’t like the doctrine, I like the active system for writing db systems, can I still completely remove the doctrine from symfony and replace it with DAL, for example, with codeigniters?

+4
source share
2 answers

Doctrine 2 is a pure implementation of the Data Mapper template. Its advantage over Active Record is that you do not need to bend your model into a database schema or vice versa. In most cases, your model and circuit can be developed separately; you only need to update the display metadata.

In addition, you do not need to extend / implement any special classes / interfaces. Your model consists of POPO (Plain Old PHP Objects), and the display is controlled by an external object - an entity manager. This allows you to use a good OO design on the PHP side and a good schema design on the database side.

So, I suggest you reconsider your desire to return to Active Record. It may take some time for a paradigm shift, but it's worth it.

+2
source

Just because Doctrine is the default choice does not mean that it is the only one. It is not tightly coupled to Symfony and can be replaced.

Symfony provides reasonable defaults, but gives you the freedom to change them.

For example, you can use Propel . It implements Active Record (unlike Doctrine2).

You can write your own implementation of ORM if you want.

Note that in addition to ORM, Doctrine has several useful helper libraries. For example, an annotation reader is used by Symfony to analyze annotations. If you use them, you will need this part of the Doctrine.

+1
source

All Articles