SortCombinator
extends
Sort
in
Enable sorting a record based on its value.
Tags
Table of Contents
Methods
- __invoke() : int
- The class comparison method.
- append() : self
- Return an instance with the specified sorting algorithm added after the currently registered sorting algorithms.
- prepend() : self
- Return an instance with the specified sorting algorithm added before the currently registered sorting algorithms.
- sort() : Iterator
- Sort an iterable structure with the class comparison method and maintain index association.
Methods
__invoke()
The class comparison method.
public
__invoke(mixed $valueA, mixed $valueB) : int
The method 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
- $valueA : mixed
- $valueB : mixed
Return values
intappend()
Return an instance with the specified sorting algorithm added after the currently registered sorting algorithms.
public
append(Ordering ...$sorts) : self
This method MUST retain the state of the current instance, and return an instance that contains the specified changes.
Parameters
- $sorts : Ordering
Return values
selfprepend()
Return an instance with the specified sorting algorithm added before the currently registered sorting algorithms.
public
prepend(Ordering ...$sorts) : self
This method MUST retain the state of the current instance, and return an instance that contains the specified changes.
Parameters
- $sorts : Ordering
Return values
selfsort()
Sort an iterable structure with the class comparison method and maintain index association.
public
sort(iterable<string|int, mixed> $value) : Iterator
Parameters
- $value : iterable<string|int, mixed>