http://www.magentocommerce.com/boards/viewthread/760042/
My model object when passed to get_class appears to be ok.
2013-12-09T11:04:27-05:00 DEBUG (7): get_class() Checkerboard_Workorder_Model_Workorderlineitem
The Object itself looks good too.
2013-12-09T11:04:27-05:00 DEBUG (7): workorderlineitem -> Checkerboard_Workorder_Model_Workorderlineitem Object ( [_eventPrefix:protected] => core_abstract [_eventObject:protected] => object [_resourceName:protected] => workorder/workorderlineitem [_resource:protected] => [_resourceCollectionName:protected] => workorder/workorderlineitem_collection [_cacheTag:protected] => [_dataSaveAllowed:protected] => 1 [_isObjectNew:protected] => [_data:protected] => Array ( [workorder_id] => 6 [udrop_ship_item_id] => 25 [order_item_id] => 100 [created_timestamp] => 1386605067 ) [_hasDataChanges:protected] => 1 [_origData:protected] => [_idFieldName:protected] => [_isDeleted:protected] => [_oldFieldsMap:protected] => Array ( ) [_syncFieldsMap:protected] => Array ( ) )
But when I call save on the object the following exception is raised:
Can’t retrieve entity config: workorder/workorderlineitem #0 /var/www/html/app/code/core/Mage/Core/Model/Resource.php(272): Mage::throwException(’Can’t retrieve ...’) #1 /var/www/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(284): Mage_Core_Model_Resource->getTableName(’workorder/worko...’) #2 /var/www/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(247): Mage_Core_Model_Resource_Db_Abstract->getTable(’workorderlineit...’) #3 /var/www/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(586): Mage_Core_Model_Resource_Db_Abstract->getMainTable() #4 /var/www/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(449): Mage_Core_Model_Resource_Db_Abstract->_prepareDataForSave(Object(Checkerboard_Workorder_Model_Workorderlineitem)) #5 /var/www/html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Checkerboard_Workorder_Model_Workorderlineitem)) #6 /var/www/html/app/code/local/Checkerboard/Workorder/Model/Observer.php(125): Mage_Core_Model_Abstract->save() #7 /var/www/html/app/code/community/Unirgy/DropshipPo/Helper/Data.php(96): Checkerboard_Workorder_Model_Observer::createWorkorders(Array) #8 /var/www/html/app/code/community/Unirgy/DropshipPo/controllers/Adminhtml/PoController.php(80): Unirgy_DropshipPo_Helper_Data->sendVendorNotification(Object(Unirgy_DropshipPo_Model_Po)) #9 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Unirgy_DropshipPo_Adminhtml_PoController->resendUdposAction() #10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch(’resendUdpos’) #11 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #12 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch() #13 /var/www/html/app/Mage.php(683): Mage_Core_Model_App->run(Array) #14 /var/www/html/index.php(93): Mage::run(’’, ‘store’) #15 {main}
I am really confused by this, as everything looks to be ok in all of my code.
The official Magento forum has a link to download all of my code.
As requested the model section of my code. <models> <workorder> <class>Checkerboard_Workorder_Model</class> <resourceModel>workorder_mysql4</resourceModel> </workorder> <workorder_mysql4> <class>Checkerboard_Workorder_Model_Mysql4</class> <entities> <workorder> <table>workorder</table> </workorder> </entities> </workorder_mysql4> <workorderlineitem> <class>Checkerboard_Workorderlineitem_Model</class> <resourceModel>workorderlineitem_mysql4</resourceModel> </workorderlineitem> <workorderlineitem_mysql4> <class>Checkerboard_Workorderlineitem_Mysql4</class> <entities> <workorderlineitem> <table>workorder_lineitem</table> </workorderlineitem> </entities> </workorderlineitem_mysql4> <picklistitem> <class>Checkerboard_Picklistitem_Model</class> <resourceModel>picklistitem_mysql4</resourceModel> </picklistitem> <picklistitem_mysql4> <class>Checkerboard_Picklistitem_Model_Mysql4</class> <entities> <picklistitem> <table>picklist_items</table> </picklistitem> </entities> </picklistitem_mysql4> <picklistproduct> <model>Checkerboard_Picklistproduct_Model</model> <resourceModel>picklistproduct_mysql4</resourceModel> </picklistproduct> <picklistproduct_mysql4> <class>Checkerboard_Picklistproduct_Model_Mysql4</class> <entities> <picklistproduct> <table>picklist_products</table> </picklistproduct> </entities> </picklistproduct_mysql4> </models>
// Model/Workorderlineitem.php /** * Workorderlineitem object model. * @author Chris Pinto */ class Checkerboard_Workorder_Model_Workorderlineitem extends Mage_Core_Model_Abstract { protected function _construct() { $this->_init('workorder/workorderlineitem'); } } // Model/Mysql4/Workorderlineitem.php /** * Workorderlineitem object Mysql4 resource model. * @author Christopher Pinto */ class Checkerboard_Workorder_Model_Mysql4_Workorderlineitem extends Mage_Core_Model_Mysql4_Abstract { protected function _construct() { $this->_init('workorder/workorderlineitem', 'entity_id'); } } // Model/Mysql4/Workorderlineitem/Collection.php/** * Workorderlineitem object Mysql4 resource model collection. * @author Christopher Pinto */ class Checkerboard_Workorder_Model_Mysql4_Workorderlineitem_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract { protected function _construct() { $this->_init('workorder/workorderlineitem'); } }