Documentation

SqlSpecTrait

If a field is specifically stored in the database, then use SqlSpecTrait to describe how to read/write the field.

Table of Contents

Properties

$columnName  : string
SQL column which stores this field.
$operators  : array<string|int, string>
If set, limits the operators that can be used on this field for "get" actions.
$sqlFilters  : array<string|int, callable>
Some fields use a callback to generate their SQL (for reading/searching).
$sqlRenderer  : callable
$tableName  : string
SQL table which stores this field.

Methods

addSqlFilter()  : $this
getColumnName()  : string|null
getTableName()  : string
setColumnName()  : $this
setOperators()  : $this
setSqlFilters()  : $this
setSqlRenderer()  : $this
setTableName()  : $this

Properties

$columnName

SQL column which stores this field.

public string $columnName

$operators

If set, limits the operators that can be used on this field for "get" actions.

public array<string|int, string> $operators

$sqlFilters

Some fields use a callback to generate their SQL (for reading/searching).

public array<string|int, callable> $sqlFilters

$tableName

SQL table which stores this field.

public string $tableName

Methods

addSqlFilter()

public addSqlFilter(callable $sqlFilter) : $this
Parameters
$sqlFilter : callable
Return values
$this

getColumnName()

public getColumnName() : string|null
Return values
string|null

getTableName()

public getTableName() : string
Return values
string

setColumnName()

public setColumnName(string|null $columnName) : $this
Parameters
$columnName : string|null
Return values
$this

setOperators()

public setOperators(array<string|int, string> $operators) : $this
Parameters
$operators : array<string|int, string>
Return values
$this

setSqlFilters()

public setSqlFilters(array<string|int, callable> $sqlFilters) : $this
Parameters
$sqlFilters : array<string|int, callable>
Return values
$this

setSqlRenderer()

public setSqlRenderer(callable $sqlRenderer) : $this
Parameters
$sqlRenderer : callable
Return values
$this

setTableName()

public setTableName(string $tableName) : $this
Parameters
$tableName : string
Return values
$this

        
On this page

Search results