Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API CHANGE: Added SS_Sortable, an extra interface to apply to SS_Lists.
- Loading branch information
Sam Minnee
authored and
Stig Lindqvist
committed
Mar 9, 2012
1 parent
f000a47
commit e9e7655
Showing
4 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* Additional interface for {@link SS_List} classes that are sortable. | ||
* | ||
* @see SS_List, SS_Filterable, SS_Limitable | ||
*/ | ||
interface SS_Sortable { | ||
|
||
/** | ||
* Returns TRUE if the list can be sorted by a field. | ||
* | ||
* @param string $by | ||
* @return bool | ||
*/ | ||
public function canSortBy($by); | ||
|
||
/** | ||
* Sorts this list by one or more fields. You can either pass in a single | ||
* field name and direction, or a map of field names to sort directions. | ||
* | ||
* @example $list->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(); | ||
|
||
} |