Flow PHP

Rows implements Countable

FinalYes

Interfaces

Countable

Methods

adoptedBy()  : self
The same batch with every column in $backend's storage - itself when $backend already owns every column.
castTo()  : self
Every column cast to $schema's definition, absent ones as nulls.
chunks()  : Generator<int, Rows>
column()  : Column
columns()  : array<string|int, Column>
concat()  : self
Every part carries $schema; zero-row parts add no rows, and no parts give an empty batch. The result's columns are $backend's.
count()  : int
drop()  : self
dropRight()  : self
empty()  : self
fromColumns()  : self
gather()  : self
isEmpty()  : bool
matchTo()  : self
Adopts $schema. A changed column whose type change the types prove is restamped; any other change is checked value by value and rebuilt in $backend.
nulls()  : self
One row, every column of $schema null (and declared nullable).
project()  : self
Drops the columns $schema does not declare and adopts it, converting a kept column whose definition $schema changes (in $backend). Contrast select(), which keeps the named columns as they are. Widening the batch with columns it lacks is not a projection - that goes through matchTo().
reduceToArray()  : array<int, mixed>
remove()  : self
schema()  : Schema
select()  : self
The named columns as they are, in schema order - every column kept unconverted, in whatever backend built it.
slice()  : self
take()  : self
toArray()  : array<int, array<string|int, mixed>>
values()  : array<string|int, mixed>
withColumns()  : self
withSchema()  : self
Positional restamp: the n-th definition of $schema retypes the n-th column (Column::withType).

Methods

adoptedBy()

The same batch with every column in $backend's storage - itself when $backend already owns every column.

public adoptedBy(Backend $backend) : self
Parameters
$backend : Backend
Tags
throws
ColumnMismatchException

a null under NOT NULL on a column that is copied

Return values
self

castTo()

Every column cast to $schema's definition, absent ones as nulls.

public castTo(Schema $schema, Backend $backend) : self
Parameters
$schema : Schema
$backend : Backend
Return values
self

chunks()

public chunks(int<1, max> $size) : Generator<int, Rows>
Parameters
$size : int<1, max>
Return values
Generator<int, Rows>

columns()

public columns() : array<string|int, Column>
Return values
array<string|int, Column> —

schema order

concat()

Every part carries $schema; zero-row parts add no rows, and no parts give an empty batch. The result's columns are $backend's.

public static concat(Schema $schema, Backend $backend, self ...$parts) : self
Parameters
$schema : Schema
$backend : Backend
$parts : self
Tags
throws
InvalidArgumentException

a part carries another schema

Return values
self

count()

public count() : int
Return values
int

drop()

public drop(int $size) : self
Parameters
$size : int
Return values
self

dropRight()

public dropRight(int $size) : self
Parameters
$size : int
Return values
self

gather()

public gather(array<int, int> $indices) : self
Parameters
$indices : array<int, int>

rows to keep, in the order given

Tags
throws
InvalidArgumentException
Return values
self

isEmpty()

public isEmpty() : bool
Return values
bool

matchTo()

Adopts $schema. A changed column whose type change the types prove is restamped; any other change is checked value by value and rebuilt in $backend.

public matchTo(Schema $schema, Backend $backend) : self
Parameters
$schema : Schema
$backend : Backend
Tags
throws
SchemaMismatchException
Return values
self

nulls()

One row, every column of $schema null (and declared nullable).

public static nulls(Schema $schema, Backend $backend) : self
Parameters
$schema : Schema
$backend : Backend
Return values
self

project()

Drops the columns $schema does not declare and adopts it, converting a kept column whose definition $schema changes (in $backend). Contrast select(), which keeps the named columns as they are. Widening the batch with columns it lacks is not a projection - that goes through matchTo().

public project(Schema $schema, Backend $backend) : self
Parameters
$schema : Schema
$backend : Backend
Tags
throws
SchemaMismatchException
Return values
self

reduceToArray()

public reduceToArray(string $name) : array<int, mixed>
Parameters
$name : string
Tags
throws
InvalidArgumentException
Return values
array<int, mixed>

remove()

public remove(int $offset) : self
Parameters
$offset : int
Return values
self

select()

The named columns as they are, in schema order - every column kept unconverted, in whatever backend built it.

public select(string ...$names) : self

Contrast project(), which adopts a given schema and converts the columns it changes.

Parameters
$names : string
Tags
throws
SchemaDefinitionNotFoundException
Return values
self

slice()

public slice(int $offset, int $length) : self
Parameters
$offset : int
$length : int
Tags
throws
InvalidArgumentException
Return values
self

take()

public take(int $size) : self
Parameters
$size : int
Return values
self

toArray()

public toArray([bool $withKeys = true ]) : array<int, array<string|int, mixed>>
Parameters
$withKeys : bool = true
Return values
array<int, array<string|int, mixed>>

values()

public values(int $i) : array<string|int, mixed>
Parameters
$i : int
Tags
throws
InvalidArgumentException
Return values
array<string|int, mixed> —

the logical row, schema order

withColumns()

public withColumns(Schema $schema, array<string|int, Column> $columns) : self
Parameters
$schema : Schema
$columns : array<string|int, Column>

each of count() rows; a same-named column is replaced in place

Tags
throws
InvalidArgumentException
Return values
self
On this page

Search results