What is the advantage of using DataMapper with Zend_Db_Table, and not just directly using DataMapper with a database adapter?

I went through the Zend Framework quick start tutorial and in their demo code they use a data card that uses Zend_DB_Table to access the database (see http://framework.zend.com/manual/en/learning.quickstart.create -model.html ). It seems that Zend_DB_Table does not use prepared statements or provides a way to use transactions. Therefore, I am inclined to simply use datamapper directly with zend_db_adapter. With that in mind, can anyone advise in what situations Zend_DB_Table will be useful? Appreciate your contribution! Greetings.

+3
source share
3 answers

In general, I see it Zend_Db_Tableas a quick and easy way to make single-table queries .

Of course, you can join Zend_Db_Table, but since the class is oriented to a specific table (after all, it is intended as an implementation of the Gateway Gateway), all such associations always feel - at least for me - as an unnatural transplant. In this case, I always tend to direct queries based on adapters with unions, which may include transaction processing.

, , , . , , , Zend_Db_Table, , , - //.

, .

+3

, , .

, , , , SQL- , , -, , . .

, , , .

, , , ( ) , ...

, , :)

+1
  • , db
  • , ..
0

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


All Articles