For that version of Magento (1.3.2.4), you need to specify read and write connections in your config.xml file.
Under <global>
, add a <resources>
node like so:
<resources>
<yourModelNode_write>
<connection>
<use>core_write</use>
</connection>
</yourModelNode_write>
<yourModelNode_read>
<connection>
<use>core_write</use>
</connection>
</yourModelNode_read>
</resources>
Make sure to refresh your cache!
This type of configuration is optional in later releases of Magento; the system will load the default read/write connections if you don't specify them in your config. I'm not sure when exactly this feature was implemented, but it is present in 1.6.x.
The difference between 1.3.2.4 and 1.6.x is located in Mage_Core_Model_Resource::getConnection().
1.6.x will return the default read/write connection if you don't have one specified in your 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 will return false:
$connConfig = Mage::getConfig()->getResourceConnectionConfig($name);
if (!$connConfig || !$connConfig->is('active', 1)) {
return false;
}
The reason why you get the "does not implement Zend_Db_Adapter_Abstract" error is located in 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();
}
When false
is passed in as the connection ($conn), it'll throw this error because -- of course -- false
is not an instance of Zend_Db_Adapter_Abstract.