Developers/Fetch records in bunches/en

Fetch records in bunches efficiently
Retrieving records in the database is always done in bunches (default: 100 records/searchItems, can be changed using MW_Common_Criteria_Interface::setslice) and if you need to process more or all items, you have to repeatedly call searchItems of the manager. The most efficient code for this is:

Note: Setting the sortation is important as MySQL isn't able to return all entries of an unsorted result only once. If you forget to add the sortation, chances are high that you will sometimes get records twice and others not at all. Please replace " " in the second parameter with the name of the domain, e.g. "product" or "product.list".