views:

189

answers:

3

Hi all! I've to change the value of protected $_autoQuoteIdentifiers but I don't know how.

class ZendX_Db_Adapter_Firebird extends Zend_Db_Adapter_Abstract
{
    protected $_autoQuoteIdentifiers = true;
.
.
.

Okay, I can change it directly in the class, but this couln't be the the best way.

My application.ini is:

resources.db.adapter = Firebird
resources.db.params.dbname = "/tmp/test.fdb"
resources.db.params.host = "127.0.0.1"
resources.db.params.username = sysdba
resources.db.params.password = masterkey
resources.db.params.adapterNamespace = "ZendX_Db_Adapter"

And the my Bootstrap.php is:

protected function _initDatabase()
    {
        $this->bootstrap('db');
        $db = $this->getResource('db');
        $db->setFetchMode(Zend_Db::FETCH_OBJ);
        Zend_Registry::set('db', $db);
        Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('db'));
    }

Any ideas?

A: 

Extend the Firebird class with one of your own, and setup the adapter to say 'My_Firebird' (or whatever) instead. You can change properties that way in the class (even making them configurable via the config passed in).

Justin
A: 

Are you sure you can't call $this->setAutoQuoteIdentifiers(false) on the adapter? :)

Tomáš Fejfar
Yes, I'm sure. Method setAutoQuoteIdentifiers doesn't exist.
former
I haven't checked, but it doesn't need to be implemented like "public function setAutoQuoteIdentifiers ()". It could be implemented in __call() as well...
Tomáš Fejfar
+2  A: 

Zend Reference Guide gives the answer: Reference Guide

$options = array(
    Zend_Db::AUTO_QUOTE_IDENTIFIERS => false
);

$params = array(
    'host'           => '127.0.0.1',
    'username'       => 'webuser',
    'password'       => 'xxxxxxxx',
    'dbname'         => 'test',
    'options'        => $options
);

$db = Zend_Db::factory('Firebird', $params);
former