Mixing Zend_Db with ORM classes

Zend has Zend_Db, but this is not a complete ORM. I already have sections of the application written in a way that uses Zend_Db. However, I want to integrate the full ORM into the application in order to use it for more complex database operations, but I do not want to overwrite the actions already performed.

Those who are more familiar with the Zend Framework, do you see a problem with using Zend_Db in some actions and ORM in other actions? Is it possible that the generated Zend_Db classes coexist with the database classes generated by ORM? What if I have to use both classes even in one action? I don't see a conflict there, but I'm not so good with MVC or ORM, so I might miss a big conflict.

+3
source share
1 answer

I worked a bit on Zend_Db through ZF version 1.0, and I used Doctrine too often.

There should be no conflict between Zend_Db and another ORM. However, objects received through the Zend_Db interface will not know objects retrieved through another ORM interface, for example. Doctrine and vice versa.

So, if your other ORM was trying to be smart about batch commit in a database, you should force it to commit before trying to load data from the same rows in the Zend_Db object. And vice versa.

, ORM-ish , , , ORM. , , , Zend_Db.

+2

Source: https://habr.com/ru/post/1767623/


All Articles