TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Collection\SortableCollectionInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Collection\SortableCollectionInterface:
t3lib_collection_Sortable TYPO3\CMS\Core\Collection\AbstractRecordCollection t3lib_collection_AbstractRecordCollection TYPO3\CMS\Core\Category\Collection\CategoryCollection TYPO3\CMS\Core\Collection\StaticRecordCollection TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection TYPO3\CMS\Frontend\Category\Collection\CategoryCollection t3lib_collection_StaticRecordCollection TYPO3\CMS\Core\Resource\Collection\CategoryBasedFileCollection TYPO3\CMS\Core\Resource\Collection\FolderBasedFileCollection TYPO3\CMS\Core\Resource\Collection\StaticFileCollection

Public Member Functions

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

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! 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 a index can be assigned

Author
Steffen Ritter <typo3steffen-ritter.net>

Definition at line 27 of file SortableCollectionInterface.php.

Member Function Documentation

◆ moveItemAt()

TYPO3\CMS\Core\Collection\SortableCollectionInterface::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
integer$currentPosition
integer$newPosition
Returns
void

Implemented in TYPO3\CMS\Core\Collection\AbstractRecordCollection.

◆ usort()

TYPO3\CMS\Core\Collection\SortableCollectionInterface::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 TYPO3\CMS\Core\Collection\AbstractRecordCollection.