Handy helper class to keep manually sorted lists more manageable.
__construct(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models, \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $siblings, string $sortedBy, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $previousModel)
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterfaceThe collection containing the models to be inserted.
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterfaceThe collection containing the models that are siblings.
stringThe property that is used for sorting.
\ContaoCommunityAlliance\DcGeneral\Data\ModelInterfaceThe model preceding the target position of the first model from the collection.
getModels() : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
getPreviousModel() : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | null
getResults() : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
getSortingProperty() : string
stringsetModels(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterfaceThe collection containing the models to be inserted.
setPreviousModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface|null $previousModel) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
\ContaoCommunityAlliance\DcGeneral\Data\ModelInterfacenullThe model preceding the target position of the first model from the collection.
setSiblings(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $siblings) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterfaceThe collection containing the models that are siblings.
setSortingProperty(string $sortingProperty) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
stringThe property that is used for sorting.
calculate() : void
\RuntimeException |
When no sorting property has been defined. |
|---|
getModelIds() : array
arrayscanToDesiredPosition() : void
determineDelta() : float | int
floatint
updateSorting() : void
$marker : null | \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
$models : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
$position : int
$previousModel : null | \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
$siblings : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
$siblingsCopy : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
$sortingProperty : string