$_defaults
$_defaults : array
Associative array with the default fields and the related types this query might contain.
Used to avoid repetition when calling multiple functions inside this class that may require a custom type for a specific field.
Implements default and single-use mappings for columns to their associated types
setDefaults(array $defaults) : $this
Configures a map of default fields and their associated types to be used as the default list of types for every function in this class with a $types param. Useful to avoid repetition when calling the same functions using the same fields and types.
$query->setDefaults(['created' => 'datetime', 'is_visible' => 'boolean']);
This method will replace all the existing type maps with the ones provided.
array | $defaults | Associative array where keys are field names and values are the correspondent type. |
defaults(array|null $defaults = null) : $this|array
Configures a map of default fields and their associated types to be used as the default list of types for every function in this class with a $types param. Useful to avoid repetition when calling the same functions using the same fields and types.
If called with no arguments it will return the currently configured types.
$query->defaults(['created' => 'datetime', 'is_visible' => 'boolean']);
This method will replace all the existing type maps with the ones provided.
array|null | $defaults | associative array where keys are field names and values are the correspondent type. |
addDefaults(array $types) : void
Add additional default types into the type map.
If a key already exists it will not be overwritten.
array | $types | The additional types to add. |
None found |
setTypes(array $types) : $this
Sets a map of fields and their associated types for single-use.
$query->setTypes(['created' => 'time']);
This method will replace all the existing type maps with the ones provided.
array | $types | Associative array where keys are field names and values are the correspondent type. |
None found |
getTypes() : array
Gets a map of fields and their associated types for single-use.
None found |
types(array|null $types = null) : $this|array
Sets a map of fields and their associated types for single-use.
If called with no arguments it will return the currently configured types.
$query->types(['created' => 'time']);
This method will replace all the existing type maps with the ones provided.
array|null | $types | associative array where keys are field names and values are the correspondent type. |
None found |
type(string $column) : null|string
Returns the type of the given column. If there is no single use type is configured, the column type will be looked for inside the default mapping. If neither exist, null will be returned.
string | $column | The type for a given column |
None found |
None found |
Loading…