I will issue as an answer because the comment does not allow formatting normally
here is the method in the file app/code/core/Mage/Core/Model/Config.php
line 1349
/** * Get model class instance. * * Example: * $config->getModelInstance('catalog/product') * * Will instantiate Mage_Catalog_Model_Mysql4_Product * * @param string $modelClass * @param array|object $constructArguments * @return Mage_Core_Model_Abstract|false */ public function getModelInstance($modelClass='', $constructArguments=array()) { $className = $this->getModelClassName($modelClass); if (class_exists($className)) { Varien_Profiler::start('CORE::create_object_of::'.$className); $obj = new $className($constructArguments); Varien_Profiler::stop('CORE::create_object_of::'.$className); return $obj; } else { return false; } }
make var_dump($className)
to see what class has been formed, it is probably wrong. We go further to the getModelClassName()
method in general we reach the method 1219 of the same file getGroupedClassName()
/** * Retrieve class name by class group * * @param string $groupType currently supported model, block, helper * @param string $classId slash separated class identifier, ex. group/class * @param string $groupRootNode optional config path for group config * @return string */ public function getGroupedClassName($groupType, $classId, $groupRootNode=null) { if (empty($groupRootNode)) { $groupRootNode = 'global/'.$groupType.'s'; } $classArr = explode('/', trim($classId)); $group = $classArr[0]; $class = !empty($classArr[1]) ? $classArr[1] : null; if (isset($this->_classNameCache[$groupRootNode][$group][$class])) { return $this->_classNameCache[$groupRootNode][$group][$class]; } $config = $this->_xml->global->{$groupType.'s'}->{$group}; // First - check maybe the entity class was rewritten $className = null; if (isset($config->rewrite->$class)) { $className = (string)$config->rewrite->$class; } else { /** * Backwards compatibility for pre-MMDB extensions. * In MMDB release resource nodes <..._mysql4> were renamed to <..._resource>. So <deprecatedNode> is left * to keep name of previously used nodes, that still may be used by non-updated extensions. */ if ($config->deprecatedNode) { $deprecatedNode = $config->deprecatedNode; $configOld = $this->_xml->global->{$groupType.'s'}->$deprecatedNode; if (isset($configOld->rewrite->$class)) { $className = (string) $configOld->rewrite->$class; } } } // Second - if entity is not rewritten then use class prefix to form class name if (empty($className)) { if (!empty($config)) { $className = $config->getClassName(); } if (empty($className)) { $className = 'mage_'.$group.'_'.$groupType; } if (!empty($class)) { $className .= '_'.$class; } $className = uc_words($className); } $this->_classNameCache[$groupRootNode][$group][$class] = $className; return $className; }
what this method does, takes from the config ime a prefix class which is specified in the models
section in general after you see the generated ime class you understand where the error is. But from experience I will say where is the typo in the config. In principle, the edited version of the CO should work.
_construct()
on php__construct()
try to replace. - Naumovbrain_crowncaliber_resource
- Naumov