mini\Table\Wrappers\SortedTable class

Documentation

Sorted table wrapper

Applies ordering to a source table. If source has an index for the order columns, delegates to source. Otherwise, buffers and sorts in-memory.

SortedTable::for($table, new OrderDef('name'), new OrderDef('age', false))

Inheritance

Extends: mini\Table\Wrappers\AbstractTableWrapper

Implements: mini\Table\Contracts\TableInterface Traversable Countable IteratorAggregate mini\Table\Contracts\SetInterface

Properties (5)

private array $orderBy
protected mini\Table\AbstractTable $source
protected ?Closure $compareFn
protected ?int $limit
protected int $offset

Methods (40)

Create sorted view of a table, optimizing where possible

Documentation missing

Documentation missing

Get the order specification for predicate inspection

Documentation missing

Materialize using a bounded heap for efficient top-k selection

Documentation missing

Documentation missing

Documentation missing

Build a row comparator function from OrderDef[]

Get the source table this wrapper delegates to

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Hook for subclasses to customize clone behavior

Get column name(s) that the row key represents

Documentation missing

Documentation missing

Documentation missing

Get the current table alias (null if not set)

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Check if value(s) exist in the table's projected columns

Get the primary key column definition (cached)

Iterate over rows with visible columns only

Return table with property set

Source

src/Table/Wrappers/SortedTable.php:23-268