class DB

The Database Model provides a base class for all database models.

Properties

protected QueryBuilder $queryBuilder The query builder instance.

Methods

__construct($table, $primaryKey = 'id')

No description

static DB
table($table, $primaryKey = 'id')

Instantiate a new DB model with the given table name.

setPrimaryKey($primaryKey)

Set the primary key for the model.

__call(string $name, array $arguments)

Proxy method for the query builder.

Details

at line 21
__construct($table, $primaryKey = 'id')

Parameters

$table
$primaryKey

at line 41
static DB table($table, $primaryKey = 'id')

Instantiate a new DB model with the given table name.

Parameters

$table
$primaryKey

Return Value

DB

at line 57
setPrimaryKey($primaryKey)

Set the primary key for the model.

Parameters

$primaryKey

at line 76
__call(string $name, array $arguments)

Proxy method for the query builder.

Parameters

string $name The method name.
array $arguments The method arguments.