mini\Table\Contracts\TableInterface::load() Method

public abstract

Signature

public abstract function load(string|int $rowId): ?object

Parameters

Name Type Default Description
$rowId string|int required Documentation missing

Returns

?object

Documentation

Load a single row by its row ID

Returns the row if it exists and matches current filters, null otherwise. This enables efficient indexed lookups without iterating.

$row = $table->load(123);           // Get row with ID 123
$row = $table->eq('status', 'active')->load(123);  // Only if active

Row IDs correspond to iteration keys:

foreach ($table as $rowId => $row) {
    $same = $table->load($rowId);   // $same === $row
}

Source

src/Table/Contracts/TableInterface.php:293