sortByMultiple

Permalink
I noticed this method in the DatabaseItemList class. So I attempted to use it with the UserList.

It works perfectly, as long as I prepend an 'ak_' to my attributes...

doesn't work...
$userList->sortByMultiple('region asc', 'last_name asc');

works...
$userList->sortByMultiple('ak_region asc', 'ak_last_name asc');

Is this how it's supposed to work? Or a bug?

 
goldfish replied on at Permalink Reply
goldfish
This method was really helpful so I thought I'd bump with a little more explanation:
custom attributes need prefacing with ak_
Look in the database for some other page variable names (which will not need the prefix)

In this case I'm using sortByMultiple to display a page list with the featured items shown first (I created my own custom attribute for this), then sorted by name:
$pl->sortByMultiple("ak_dir_is_featured_listing desc","cvName asc");