Returns a collection of the items in this collection sorted by the given field in the order of a supplied values map. This is a difficult concept to explain, so please refer to the example!
Parameters:
-
The name of the field to retrieve the property to sort by
-
The values to sort to (see the example which illustrates this better).
-
String $order = ASC
The order of the sort, either “ASC” for (ascending), or “DESC” (descending)
-
Boolean $clone = false
If true, the original collection will be untouched, and a clone of the sorted collection will be returned instead.