Documentation

Column
in package
implements Sort

FinalYes

Enable sorting a record based on the value of a one of its cell.

Table of Contents

Interfaces

Sort
Enable sorting a record based on its value.

Constants

ASCENDING  = 'ASC'
DESCENDING  = 'DESC'

Properties

$callback  : Closure
$column  : string|int
$direction  : string

Methods

__invoke()  : int
The class comparison method.
sort()  : Iterator
Sort an iterable structure with the class comparison method and maintain index association.
sortOn()  : self
__construct()  : mixed

Constants

ASCENDING

private mixed ASCENDING = 'ASC'

DESCENDING

private mixed DESCENDING = 'DESC'

Properties

$callback read-only

public Closure $callback

$column read-only

public string|int $column

$direction read-only

public string $direction

Methods

__invoke()

The class comparison method.

public __invoke(mixed $valueA, mixed $valueB) : int
Parameters
$valueA : mixed
$valueB : mixed
Tags
throws
ReflectionException
throws
QueryException
Return values
int

sort()

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>
Return values
Iterator

sortOn()

public static sortOn(string|int $column, string|int $direction[, callable(mixed, mixed): int|null $callback = null ]) : self
Parameters
$column : string|int
$direction : string|int
$callback : callable(mixed, mixed): int|null = null
Tags
throws
QueryException
Return values
self

__construct()

private __construct(string $direction, string|int $column, callable(mixed, mixed): int $callback) : mixed
Parameters
$direction : string
$column : string|int
$callback : callable(mixed, mixed): int

        
On this page

Search results