Flow PHP

ColumnRetyping

Read onlyYes
FinalYes

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

cast()

$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
throws
SchemaMismatchException

a value the cast refuses, at its row

Return values
Column

restamped()

$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|null

validate()

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
Tags
throws
SchemaMismatchException
On this page

Search results