我正在开发命令行扩展的操作,仿照内置的cron.php 代码如下
扩展.php
require 'app/Mage.php';
$lowstockCollection = Mage::getResourceModel('reports/product_lowstock_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->filterByIsQtyProductTypes()
->joinInventoryItem('qty')
->useManageStockFilter($storeId)
->useNotifyStockQtyFilter($storeId)
->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);
执行,出现如下信息“Call to a member function getResourceModelInstance() on a non-object”
对应的函数如下
应用程序/Mage.php
public static function getResourceModel($modelClass, $arguments = array())
{
return self::getConfig()->getResourceModelInstance($modelClass, $arguments);
}
很明显,self::getConfig() -> getResourceModelInstance() 的问题
请问如何使用Command-Line Executive Mage::getResourceModel呢?