[TASK] Re-work/simplify copyright header in PHP files - Part 2
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Collection / SortableCollectionInterface.php
1 <?php
2 namespace TYPO3\CMS\Core\Collection;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Interface for collection class being sortable
18 *
19 * This interface allows you to either define a callback implementing
20 * your own sorting method and explicitly move an item from one position
21 * to another.
22 *
23 * This assumes that entries are sortable and therefore a index can be assigned
24 *
25 * @author Steffen Ritter <typo3steffen-ritter.net>
26 */
27 interface SortableCollectionInterface
28 {
29 /**
30 * Sorts collection via given callBackFunction
31 *
32 * The comparison function given as must return an integer less than, equal to, or greater than
33 * zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
34 *
35 * @param $callbackFunction
36 * @see http://www.php.net/manual/en/function.usort.php
37 * @return void
38 */
39 public function usort($callbackFunction);
40
41 /**
42 * Moves the item within the collection
43 *
44 * The item at $currentPosition will be moved to
45 * $newPosition. Omiting $newPosition will move to top.
46 *
47 * @param integer $currentPosition
48 * @param integer $newPosition
49 * @return void
50 */
51 public function moveItemAt($currentPosition, $newPosition = 0);
52
53 }