MetaModels / core

MetaModels Core Module
GNU Lesser General Public License v3.0
96 stars 42 forks source link

WIP/idea - Deep Sort/Mutli Sort #1034

Open stefanheimes opened 8 years ago

stefanheimes commented 8 years ago

Thing about it, how to add the deep sorting or multi sorting in metamodels.

One idea from @davidmaack was to ask each attribute and get the sorted ID's and the values. Now you can check the first list, if you have some duplicate values, you get this ID's and make a lookup in the second array list to get the sorting and so on.

Be careful we get a list from all attributes and don't do a sub-sql only for this ID's.

I have look in PHP there are some nice function:

http://php.net/manual/de/function.array-keys.php Good to find the keys from some values, if we use the search pram from this funktion.

http://us2.php.net/manual/en/function.array-count-values.php Good to check if we have duplicate values.

discordier commented 8 years ago

For id sorting, have a look in ToolBoxFile where I already implemented id lookup sorting. :)

On the overall topic, this will only work for simple values like text and the like I asusme. Deep comparing array will most likely be a time killer.