I have a class to manipulate orders. I have created multiple methods for each purpose too. There can be multiple orders to process which is generated from db. Right now, what I am doing is that, loop through each order and create objects with order id as param to constructor.
foreach($order_row as $order_rows)
{
$order_id=$order_rows->order_id ;
$warehouse =new WarehouseManager($order_id);
$warehouse->ProcessWarehouse();
}
Is it okay to loop like this? Is there any better way to handle this?
$warehouseon each iteration, and it doesn't really look like you would need a new instance of theWarehouseManagerfor every iteration, but that really depends on what the class does ?