I have taken over an application written with the use of the Zend MVC and Zend_Db_Table for DB access. I am trying to add a new table but get the error:
Base table or view not found: 1146 Table 'maa_agencies.contact' doesn't exist
However maa_agcencies.contact very much DOES exists and is in the same DB as the rest of the tables being accessed.
Here are my steps and code:
Step 1:
Create the Model Class
file: application/models/DbTable/Contact.php
class Model_DbTable_Contact extends Zend_Db_Table_Abstract
{
protected $_name = 'contact';
}
Step 2:
Instantiate the Class the same way it's done a dozen time in a controller (all other tables work)
file: application/modules/agency/controllers/IndexController.php (also step 3)
$agency_contact = new Model_DbTable_Contact();
Step 3:
Write my data to my new table ($store_contact is an assoc array with key = column name value = value)
$agency_contact->insert($store_contact);
Is there some caching function in Zend I am unaware of?
Some special thing I need to do to tell it I added a new table?
All documentation I have come across says this is all that is required, and as I state above the file I am trying to access my table through is already accessing 2 other tables in the same DB, in fact the line just above where I instantiate my Contact model is this statement that works fine:
$sm = new Model_DbTable_SentEmail();
The name space idea seems awesome! If this system wasn't some bastardization of the framework. Here is a currently working Model
/**
* @category Model_DbTable
* @package Model_DbTable_States
class Model_DbTable_States extends Zend_Db_Table_Abstract
{
protected $_name = 'state_list';
}
Is there some vodoo in the commenting perhaps, I am unable to find anywhere in the code where a namespace is registered at all.