Magento 带有消息的Mage#u Core#u异常';无法检索实体配置:sales/Array';
以下代码在Magento 1.6下运行正常,但在1.5.0.1下运行时引发Mage_Core_异常(消息:“无法检索实体配置:销售/阵列”)。我需要做什么才能让代码在Magento 1.5.0.1下运行Magento 带有消息的Mage#u Core#u异常';无法检索实体配置:sales/Array';,magento,magento-1.5,Magento,Magento 1.5,以下代码在Magento 1.6下运行正常,但在1.5.0.1下运行时引发Mage_Core_异常(消息:“无法检索实体配置:销售/阵列”)。我需要做什么才能让代码在Magento 1.5.0.1下运行 $results = Mage::getResourceModel('sales/order_collection'); $results->join( array('status_key_table' => 'order_status'),
$results = Mage::getResourceModel('sales/order_collection');
$results->join(
array('status_key_table' => 'order_status'),
'main_table.status = status_key_table.status',
array('status_key_table.label')
);
谢谢你,Ben如果比较1.5.0.1和1.6.2.0之间的join()方法:
1.5.0.1: Mage_Core_Model_Mysql4_Collection_Abstract::join()
public function join($table, $cond, $cols='*')
{
if (!isset($this->_joinedTables[$table])) {
$this->getSelect()->join(array($table=>$this->getTable($table)), $cond, $cols);
$this->_joinedTables[$table] = true;
}
return $this;
}
1.6.2.0: Mage_Core_Model_Resource_Db_Collection_Abstract::join()
public function join($table, $cond, $cols = '*')
{
if (is_array($table)) {
foreach ($table as $k => $v) {
$alias = $k;
$table = $v;
break;
...
您可以看到1.5.0.1不支持别名。相反,它对传入的第一个参数调用$this->getTable(),该参数应该是字符串。因此,在您的情况下,您需要传入'sales/order_status'作为第一个参数。关于
var/report
目录中的错误报告文件,您是否检查了与此错误相关的文件?