Customized sorting

This is a very special (and useful) group of functions. It allows you to customize the sorting behavoir of the Midgard Function. Basically it gives you a far greater control over the sorting Process then mgd_list_* does. Even a grouping function is there, which lets you group the result by specified field.

The basic idea is working on ID-Arrays, rather then fetchable objects. These can then be sorted with some eval and Array magic.

These functions are as generic as possible and therefore not limited to Midgard-Objects alone.

Performance considerations

These functions need to do a large number of database queries due to the fact, that they do all sorting on a PHP level. They are not optimized in this respect. If performance is your top consideration, you should think about doing this stuff somehow else, perhaps using fields after which Midgard actually can sort on a DB level.