I am building an admin module which extends the sales order mass actions.
I am at the point where I have added my module to the mass action dropdown, and am receiving the post data in my controller.
My question is what is the correct method to add in my custom functions that process and return data back to the controllers and where would I store them in best practice?
Eg if I am collecting the post data in my controller like so:
$orderIds = $this->getRequest()->getPost('order_ids', array());
and then I go through the orders like so and want to use a custom...
foreach ($orderIds as $orderId){
$order = Mage::getModel('sales/order')->load($orderId);
echo myCustomFunction($orderId);
}
Where would I store this custom function, and how would I call it into the controller? Usually outside of Magento I would create something like a functions.php file and put an include_once but I have a feeling that isn't the best way to go with the Magento architecture.