diff --git a/model/ArrayList.php b/model/ArrayList.php index 1de211f40..fe7bd91f2 100644 --- a/model/ArrayList.php +++ b/model/ArrayList.php @@ -5,7 +5,7 @@ * @package sapphire * @subpackage model */ -class ArrayList extends ViewableData implements SS_List, SS_Filterable, SS_Limitable { +class ArrayList extends ViewableData implements SS_List, SS_Filterable, SS_Sortable, SS_Limitable { /** * Holds the items in the list diff --git a/model/DataList.php b/model/DataList.php index bb9e2bfa4..92af851e1 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -6,7 +6,7 @@ * @package sapphire * @subpackage model */ -class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Limitable { +class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortable, SS_Limitable { /** * The DataObject class name that this data list is querying * diff --git a/model/ListDecorator.php b/model/ListDecorator.php index 46efb202b..53da6a0a0 100644 --- a/model/ListDecorator.php +++ b/model/ListDecorator.php @@ -7,7 +7,7 @@ * @package sapphire * @subpackage model */ -abstract class SS_ListDecorator extends ViewableData implements SS_List, SS_Filterable, SS_Limitable { +abstract class SS_ListDecorator extends ViewableData implements SS_List, SS_Sortable, SS_Filterable, SS_Limitable { protected $list; diff --git a/model/Sortable.php b/model/Sortable.php new file mode 100644 index 000000000..e916f3529 --- /dev/null +++ b/model/Sortable.php @@ -0,0 +1,29 @@ +sort('Name'); // default ASC sorting + * @example $list->sort('Name DESC'); // DESC sorting + * @example $list->sort('Name', 'ASC'); + * @example $list->sort(array('Name'=>'ASC,'Age'=>'DESC')); + */ + public function sort(); + +} \ No newline at end of file