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\CollectionInterface
The collection containing the models to be inserted.
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
The collection containing the models that are siblings.
string
The property that is used for sorting.
\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
The 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
string
setModels(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $models) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface
The collection containing the models to be inserted.
setPreviousModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface|null $previousModel) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
null
The 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\CollectionInterface
The collection containing the models that are siblings.
setSortingProperty(string $sortingProperty) : \ContaoCommunityAlliance\DcGeneral\Controller\SortingManager
string
The property that is used for sorting.
calculate() : void
\RuntimeException |
When no sorting property has been defined. |
---|
getModelIds() : array
array
scanToDesiredPosition() : void
determineDelta() : float | int
float
int
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