views:

139

answers:

2

Hello,

How could I set up custom DB adapter (I will use simple DBSimple) and then use it inside of my model? I don't want to extend my model with Zend_Db_Table, it seems pretty useless for me at the moment.

Sorry for question, but I'm real noob in ZF.

Thank you

+4  A: 

If you really want to have a custom adapter in the ZF sense, you have to extend their Zend_Db_Adapter_Abstract class and implement all methods within for use with DBSimple. If you do this, you can use the adapter with the entire Zend_Db package and you would also set it up like any other ZF adapter.

If you don't care about compatibility with the Zend_Db package, you just use DBSimple like you always do. If you want to set it up during your app's bootstrap and you are using Zend_Application, either create a custom Resource Plugin or add an _initDb method in your Zend_Application_Bootstrap_Bootstrap. See the chapter on Zend_Application in the reference guide for more details on how to do this.

Gordon
I don't want to use Zend_Db, so I will use Bootstrap.Thank you very much!
Kirzilla
A: 
binkabir