ColumnRetyping
One column brought under another definition of the same name: Rows::matchTo() validates the values the types cannot prove, a declared schema over another frame's batch casts them.
Methods
- absent() : Column
- The column a batch of $count rows lacks: nulls, or refused under NOT NULL when there is a row to refuse.
- cast() : Column
- $column under $definition for a declared schema over another frame's batch: restamped when the types prove the change, otherwise cast value by value into $backend - a value the definition does not take is cast, not refused.
- notNull() : void
- Refuses the first null of $column when $definition is NOT NULL.
- rebuilt() : Column
- $column's values built anew under $definition in $backend.
- restamped() : Column|null
- $column as it is when $own is $definition, restamped when the types prove the change and no null breaks a NOT NULL definition, null otherwise - the caller then casts or validates it.
- validate() : void
- Rows::matchTo()'s check of the columns restamped() could not prove: every value must already be one its definition takes - nothing is cast. One row-major scan, so the refusal names the lowest bad row and, within it, the first column in the given order. Contrast cast(), which converts such values instead.
Methods
absent()
The column a batch of $count rows lacks: nulls, or refused under NOT NULL when there is a row to refuse.
public
absent(Definition<string|int, mixed> $definition, int $count, Backend $backend) : Column
Parameters
- $definition : Definition<string|int, mixed>
- $count : int
- $backend : Backend
Tags
Return values
Columncast()
$column under $definition for a declared schema over another frame's batch: restamped when the types prove the change, otherwise cast value by value into $backend - a value the definition does not take is cast, not refused.
public
cast(Column $column, Definition<string|int, mixed> $own, Definition<string|int, mixed> $definition, Backend $backend) : Column
Contrast validate(), which refuses it.
Parameters
- $column : Column
- $own : Definition<string|int, mixed>
- $definition : Definition<string|int, mixed>
- $backend : Backend
Tags
Return values
ColumnnotNull()
Refuses the first null of $column when $definition is NOT NULL.
public
notNull(Definition<string|int, mixed> $definition, Column $column) : void
Parameters
- $definition : Definition<string|int, mixed>
- $column : Column
Tags
rebuilt()
$column's values built anew under $definition in $backend.
public
rebuilt(Column $column, Definition<string|int, mixed> $definition, Backend $backend) : Column
Parameters
- $column : Column
- $definition : Definition<string|int, mixed>
- $backend : Backend
Tags
Return values
Columnrestamped()
$column as it is when $own is $definition, restamped when the types prove the change and no null breaks a NOT NULL definition, null otherwise - the caller then casts or validates it.
public
restamped(Column $column, Definition<string|int, mixed> $own, Definition<string|int, mixed> $definition) : Column|null
Parameters
- $column : Column
- $own : Definition<string|int, mixed>
- $definition : Definition<string|int, mixed>
Return values
Column|nullvalidate()
Rows::matchTo()'s check of the columns restamped() could not prove: every value must already be one its definition takes - nothing is cast. One row-major scan, so the refusal names the lowest bad row and, within it, the first column in the given order. Contrast cast(), which converts such values instead.
public
validate(array<string, Definition} > $changed, int $count) : void
Parameters
-
$changed
: array<string, Definition
} > -
by name, in schema order
- $count : int