The read resource dbModel does not implement Zend_Db_Adapter_Abstract in Magento version 1.3.2.4

I created my own module for my Magento project. This module works in Magento 1.6.X. But for now, I am installing this extension in Magento version 1.3.2.4. Magento throws below errors.

dbModel read resource does not implement Zend_Db_Adapter_Abstract

Many forums have discussed this issue. But unfortunately. I am not getting any results.

I cleared the cache, Reindexed. What else should I do to solve this problem.

Var the resolution of the folder 777 is configured . Even I tried in a new installation of Magento, but with the same error.

Thanks in advance.

+3
source share
3 answers

For this version of Magento (1.3.2.4), you need to specify read and write connections in the config.xml file.

<global> <resources> node :

<resources>
    <yourModelNode_write>
        <connection>
            <use>core_write</use>
        </connection>
    </yourModelNode_write>
    <yourModelNode_read>
        <connection>
            <use>core_write</use>
        </connection>
    </yourModelNode_read>
</resources>

!

Magento; / , . , , 1.6.x.

1.3.2.4 1.6.x Mage_Core_Model_Resource:: getConnection().

1.6.x / , config.xml :

Mage_Core_Model_Resource:: GetConnection()

$connConfig = Mage::getConfig()->getResourceConnectionConfig($name);

if (!$connConfig) {
    $this->_connections[$name] = $this->_getDefaultConnection($name);
    return $this->_connections[$name];
}

1.3.2.4 false:

$connConfig = Mage::getConfig()->getResourceConnectionConfig($name);

if (!$connConfig || !$connConfig->is('active', 1)) {
    return false;
}

, " Zend_Db_Adapter_Abstract", Varien_Data_Collection_Db:: setConnection():

public function setConnection($conn)
{
    if (!$conn instanceof Zend_Db_Adapter_Abstract) {
        throw new Zend_Exception('dbModel read resource does not implement Zend_Db_Adapter_Abstract');
    }

    $this->_conn = $conn;
    $this->_select = $this->_conn->select();
}

false ($ conn), , , , false Zend_Db_Adapter_Abstract.

+5

/ MAGENTO_ROOT/var/cache/ .

dbModel Zend_Db_Adapter_Abstract

+9

dbModel, Zend_Db_Adapter_Abstract. . , , , PHP (http://php.net/manual/en/language.oop5.interfaces.php)

So, in any case, whatever the dbModel, you need to make sure its class definition contains "implements Zend_Db_Adapter_Abstract" after the class name.

Not knowing what you are trying to accomplish using your module, which deals with everything that I can tell you (basically explain the error). I have a suspicion that dbModel is the main object of Magento, and if so, I believe that you are incompatible between the two versions of Magento.

However, if dbModel is one of your classes, adding tools to the class definition should clear the error.

+2
source

All Articles