cancel
Showing results for 
Search instead for 
Did you mean: 

Get order - is there a memory friendly way?

Get order - is there a memory friendly way?

Hello together,

i have a problem with a script for order statistics. I have to go through hundrets or thousands of orders and collect data. Every time i load an order, it increases the memory usage, the old order is still in memory. I tried OrderRepositoryInterface, OrderInterface and everything i found, but the memory runs out on many orders. Is there a way to free up the memory when im done with one order?

In Magento 1 the script runs good with loading the order by sales/order model. Is there a similar way on Magento 2?

The hard way would be to get all data by sql, handling is easier with the order object.

 

Thanks and Regards,

Andreas