Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added sortable interface
- Loading branch information
Showing
5 changed files
with
66 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Restack\Dependency; | ||
|
||
/** | ||
* Dependable datastructure interface | ||
* | ||
* @category Restack | ||
* @package Restack\Dependency | ||
*/ | ||
interface Sortable | ||
{ | ||
/** | ||
* Search for an item in storage | ||
* @param mixed $item | ||
* @return integer|false Item key or false if not found | ||
*/ | ||
public function search($item); | ||
|
||
/** | ||
* Get the item index | ||
* @return array | ||
*/ | ||
public function getItems(); | ||
|
||
/** | ||
* Get the priority of an item | ||
* @param mixed $item | ||
* @throws Restack\Exception\InvalidItemException | ||
* @return integer | ||
*/ | ||
public function getOrder($item); | ||
|
||
/** | ||
* Set the priority of an item | ||
* @param mixed $item | ||
* @param integer $order | ||
* @throws Restack\Exception\InvalidItemException | ||
* @return void | ||
*/ | ||
public function setOrder($item, $order); | ||
} |
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