https://github.com/thecodingmachine/utils.common.sortable-interface
This package contains an interface used by objects to say they can sort data. The concept is very simple, the object implements a sort method that takes a key (the sort column) and a direction, and that's it!
https://github.com/thecodingmachine/utils.common.sortable-interface
Last synced: 3 months ago
JSON representation
This package contains an interface used by objects to say they can sort data. The concept is very simple, the object implements a sort method that takes a key (the sort column) and a direction, and that's it!
- Host: GitHub
- URL: https://github.com/thecodingmachine/utils.common.sortable-interface
- Owner: thecodingmachine
- License: mit
- Created: 2013-07-13T10:55:11.000Z (almost 13 years ago)
- Default Branch: 1.0
- Last Pushed: 2017-05-17T16:17:42.000Z (about 9 years ago)
- Last Synced: 2025-02-16T12:30:30.751Z (over 1 year ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 1
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
What is this package
====================
This package contains an interface used by many objects to declare they have the ability
to sort the result set they represent.
If your objects represent a resultset (for instance your object is a resultset from a query to a database),
and if you can sort this result set (on a column of the resultset),
then your object should implement *SortableInterface*.
```php
interface SortableInterface {
const ASC = "ASC";
const DESC = "DESC";
/**
* Sorts the result set.
*
* @param string $key The key to sort upon
* @param string $direction Either SortableInterface::ASC or SortableInterface::DESC
*/
public function sort($key, $direction = self::ASC);
}
```
Mouf package
------------
This package is part of Mouf (http://mouf-php.com), an effort to ensure good developing practices by providing a graphical dependency injection framework.