mini\Database\ModelScopedTable
class
Documentation
MutableTableInterface decorator that enforces Model authorization on writes
Wraps the inner table registered in VirtualDatabase. By the time rows reach this decorator, VDB has already applied the scope WHERE at the SQL level (Layer 1). This decorator adds per-entity can() checks (Layer 2).
Write operations use a snapshot-then-pin pattern (in-memory equivalent of SELECT FOR UPDATE): rows are materialized once, authorization is checked on the snapshot, and the actual operation is pinned to exactly those row IDs. This eliminates the TOCTOU gap between checking and operating.
- insert(): gates on can(Create, $modelClass)
- update(): snapshots rows, checks can(Update, $entity) per row, pins by PK
- delete(): snapshots rows, checks can(Delete, $entity) per row, pins by PK
- reads: pass through (VDB applied readable scope at SQL level)
Inheritance
Extends: mini\Table\Wrappers\AbstractTableWrapper
Implements:
mini\Table\Contracts\SetInterface
IteratorAggregate
Countable
Traversable
mini\Table\Contracts\TableInterface
mini\Table\Contracts\MutableTableInterface
Properties (7)
string $primaryKey
Closure $compareFn
int $limit
int $offset
Methods (40)
Documentation missing
Get the model configuration for this table
Documentation missing
Documentation missing
Documentation missing
public
getSource()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Get the source table this wrapper delegates to
public
getProperty()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
hasProperty()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
protected
materialize()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
getColumns()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
getAllColumns()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
columns()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
count()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
load()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
protected
getCompareFn()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
eq()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
lt()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
lte()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
gt()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
gte()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
in()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
like()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
order()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
or()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
limit()
inherited from mini\Table\Wrappers\AbstractTableWrapper
Documentation missing
public
__clone()
inherited from mini\Table\AbstractTable
Hook for subclasses to customize clone behavior
public
getRowKeyColumns()
inherited from mini\Table\AbstractTable
Get column name(s) that the row key represents
public
offset()
inherited from mini\Table\AbstractTable
Documentation missing
public
getLimit()
inherited from mini\Table\AbstractTable
Documentation missing
public
getOffset()
inherited from mini\Table\AbstractTable
Documentation missing
public
withAlias()
inherited from mini\Table\AbstractTable
Documentation missing
public
getTableAlias()
inherited from mini\Table\AbstractTable
Get the current table alias (null if not set)
public
union()
inherited from mini\Table\AbstractTable
Documentation missing
public
except()
inherited from mini\Table\AbstractTable
Documentation missing
public
distinct()
inherited from mini\Table\AbstractTable
Documentation missing
public
exists()
inherited from mini\Table\AbstractTable
Documentation missing
public
has()
inherited from mini\Table\AbstractTable
Check if value(s) exist in the table's projected columns
protected
getPrimaryKeyColumn()
inherited from mini\Table\AbstractTable
Get the primary key column definition (cached)
public
final
getIterator()
inherited from mini\Table\AbstractTable
Iterate over rows with visible columns only
public
withProperty()
inherited from mini\Table\AbstractTable
Return table with property set