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
$sqlRenderer
public
callable
$sqlRenderer
$tableName
SQL table which stores this field.
public
string
$tableName
Methods
addSqlFilter()
public
addSqlFilter(callable $sqlFilter) : $this
Parameters
- $sqlFilter : callable
Return values
$thisgetColumnName()
public
getColumnName() : string|null
Return values
string|nullgetTableName()
public
getTableName() : string
Return values
stringsetColumnName()
public
setColumnName(string|null $columnName) : $this
Parameters
- $columnName : string|null
Return values
$thissetOperators()
public
setOperators(array<string|int, string> $operators) : $this
Parameters
- $operators : array<string|int, string>
Return values
$thissetSqlFilters()
public
setSqlFilters(array<string|int, callable> $sqlFilters) : $this
Parameters
- $sqlFilters : array<string|int, callable>
Return values
$thissetSqlRenderer()
public
setSqlRenderer(callable $sqlRenderer) : $this
Parameters
- $sqlRenderer : callable
Return values
$thissetTableName()
public
setTableName(string $tableName) : $this
Parameters
- $tableName : string