1

In Zend Framework you can override table setup methods as explained here: http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.defining.setup

My question is what is the use of this? Under what circumstances would this be used?

It seems pointless to me because why would you want to change the primarykey value or tablename of your class to something other than what they actually are?

Yasser1984
  • 2,401
  • 4
  • 32
  • 55

1 Answers1

1

You might want to use the same Zend_Db_Table class with different scenarios. In my case, I needed to use the same table structure across different schemas and table names for a project. So, I could use the same class to access, for instance:

  • In schema db1:
    • table tableA
    • table tableB
    • ...
  • In schema db2:
    • table tableC
    • table tableD
    • ...

(All tables having the same structure, but different names).

Actually, this flexibility was the main reason why I chose to use Zend Framework for this project.

Hope that helps,

dinopmi
  • 2,683
  • 19
  • 24