I want to extend Mage_Sales_Model_Resource_Order_Shipment_Item_Collection because it doesn't come with a getIntervals() function.

So I created following files:


class MyModule_Modulename_Model_Mysql4_Shipping_Collection 
extends Mage_Core_Model_Mysql4_Collection_Abstract {

public function _construct() {



In my order grid I want to call the collection with

$collection = Mage::getResourceModel('modulename/mymodule_modulename_shipping_collection');

But the collection is empty and I can't figure out why. Can anyone point me in the right direction, please?

1 Answer 1


I want to extend Mage_Sales_Model_Resource_Order_Shipment_Item_Collection

But you didn't. You extended Mage_Core_Model_Mysql4_Collection_Abstract. The _init() parameter is used to determine the model which belongs to the collection, you cannot use it to extend another collection.

So change the class to

class MyModule_Modulename_Model_Mysql4_Shipping_Collection extends Mage_Sales_Model_Resource_Order_Shipment_Item_Collection
    // add your getInterval() method here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.