mini\Table\Wrappers\DistinctTable class

Documentation

Table wrapper that removes duplicate rows

Deduplication is based on the visible columns at the time distinct() was called. Uses TreapIndex for O(1) duplicate detection during iteration.

// Unique roles
$table->columns('role')->distinct();

// Unique role+name combos, then project to role
$table->columns('role', 'name')->distinct()->columns('role');

Inheritance

Extends: mini\Table\Wrappers\AbstractTableWrapper

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

Properties (4)

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

Methods (37)

Documentation missing

Documentation missing

Documentation missing

Distinct of distinct is still distinct - return self

Documentation missing

Generate a unique key for a row based on visible columns

Documentation missing

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

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

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/DistinctTable.php:25-126