TYPO3  7.6
Public Member Functions | List of all members
SortableCollectionInterface Interface Reference
Inheritance diagram for SortableCollectionInterface:
AbstractRecordCollection CategoryCollection StaticRecordCollection AbstractFileCollection CategoryCollection CategoryBasedFileCollection FolderBasedFileCollection StaticFileCollection

Public Member Functions

 usort ($callbackFunction)
 
 moveItemAt ($currentPosition, $newPosition=0)
 

Detailed Description

Interface for collection class being sortable

This interface allows you to either define a callback implementing your own sorting method and explicitly move an item from one position to another.

This assumes that entries are sortable and therefore an index can be assigned

Definition at line 26 of file SortableCollectionInterface.php.

Member Function Documentation

moveItemAt (   $currentPosition,
  $newPosition = 0 
)

Moves the item within the collection

The item at $currentPosition will be moved to $newPosition. Omiting $newPosition will move to top.

Parameters
int$currentPosition
int$newPosition
Returns
void

Implemented in AbstractRecordCollection.

usort (   $callbackFunction)

Sorts collection via given callBackFunction

The comparison function given as must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Parameters
$callbackFunction
See Also
http://www.php.net/manual/en/function.usort.php
Returns
void

Implemented in AbstractRecordCollection.