|
Hello, I’m developing the operation of the Command-Line Expansion, modeled on the built-in cron.php
The code is as follows
expansion.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);
Execution, the following message appears
“Call to a member function getResourceModelInstance() on a non-object”
Corresponding to the function as follows
app/Mage.php
public static function getResourceModel($modelClass, $arguments = array()) { return self::getConfig()->getResourceModelInstance($modelClass, $arguments); }
Obviously, self :: getConfig () -> getResourceModelInstance () problem
I would like to ask how to use Command-Line Executive Mage :: getResourceModel it?
|