mini\Database\VirtualDatabase::registerModel()
Method
public
Signature
public function registerModel(string $tableName, string $class, ?mini\Database\Query $readable = NULL, ?mini\Database\Query $updatable = NULL, ?mini\Database\Query $deletable = NULL, ?bool $allowInsert = NULL): self
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tableName |
string |
required | Documentation missing |
$class |
string |
required | Documentation missing |
$readable |
?mini\Database\Query |
NULL
|
Documentation missing |
$updatable |
?mini\Database\Query |
NULL
|
Documentation missing |
$deletable |
?mini\Database\Query |
NULL
|
Documentation missing |
$allowInsert |
?bool |
NULL
|
Documentation missing |
Returns
self
Documentation
Register a Model class for a table, enabling auth-aware operations
Wraps the existing table with ModelScopedTable for per-entity authorization, and stores scope configuration for WHERE merging at SQL level.
Scope Queries (readable/updatable/deletable) are lazily evaluated: if null, VDB calls the model's default method (e.g., User::query()) at execution time. Explicit Query overrides are evaluated eagerly (must be created from this VDB).