SelectParamTrait
Table of Contents
Properties
- $select : array<string|int, mixed>
- Fields to return for each $ENTITY. Defaults to all fields `[*]`.
Methods
- addSelect() : $this
- Add one or more fields to be selected (wildcard * allowed)
- expandSelectClauseWildcards() : mixed
- Adds all standard fields matched by the * wildcard
- getSelect() : array<string|int, mixed>
- setSelect() : $this
Properties
$select
Fields to return for each $ENTITY. Defaults to all fields `[*]`.
protected
array<string|int, mixed>
$select
= []
Use the * wildcard by itself to select all available fields, or use it to match similarly-named fields.
E.g. is_*
will match fields named is_primary, is_active, etc.
Set to ["row_count"]
to return only the number of $ENTITIES found.
Methods
addSelect()
Add one or more fields to be selected (wildcard * allowed)
public
addSelect(string ...$fieldNames) : $this
Parameters
- $fieldNames : string
Return values
$thisexpandSelectClauseWildcards()
Adds all standard fields matched by the * wildcard
public
expandSelectClauseWildcards() : mixed
Note: this function only deals with simple wildcard expressions. It ignores those containing special characters like dots or parentheses, they are handled separately in Api4SelectQuery.
Tags
getSelect()
public
getSelect() : array<string|int, mixed>
Return values
array<string|int, mixed>setSelect()
public
setSelect([array<string|int, mixed> $selects = ]) : $this
Set array of fields to be selected (wildcard * allowed)
Parameters
- $selects : array<string|int, mixed> =