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

public abstract

Signature

public abstract function exists(): bool

Returns

bool

Documentation

Check if the table has any rows

Implementations may optimize this (e.g., SELECT EXISTS(...) for databases). Default implementation uses limit(1)->count() > 0.

if ($table->eq('status', 'active')->exists()) {
    // At least one active row
}

Source

src/Table/Contracts/TableInterface.php:270