Flow PHP

DSL

Functions

telemetry_options()

telemetry_options([bool $trace_loading = false ][, bool $trace_transformations = false ][, bool $trace_cache = false ][, bool $collect_metrics = false ][, FilesystemTelemetryOptions|null $filesystem = null ]) : TelemetryOptions
Parameters
$trace_loading : bool = false
$trace_transformations : bool = false
$trace_cache : bool = false
$collect_metrics : bool = false
$filesystem : FilesystemTelemetryOptions|null = null
Return values
TelemetryOptions

from_rows()

from_rows(Rows ...$rows) : RowsExtractor
Parameters
$rows : Rows
Return values
RowsExtractor

from_array()

from_array(iterable<string|int, array<string|int, mixed>> $array[, null|Schema $schema = null ]) : ArrayExtractor
Parameters
$array : iterable<string|int, array<string|int, mixed>>
$schema : null|Schema = null
  • @deprecated use withSchema() method instead
Return values
ArrayExtractor

from_cache()

from_cache(string $id[, null|Extractor $fallback_extractor = null ][, bool $clear = false ]) : CacheExtractor
Parameters
$id : string
  • cache id from which data will be extracted
$fallback_extractor : null|Extractor = null
  • extractor that will be used when cache is empty - @deprecated use withFallbackExtractor() method instead
$clear : bool = false
  • clear cache after extraction - @deprecated use withClearOnFinish() method instead
Return values
CacheExtractor

filesystem_cache()

filesystem_cache([Path|string|null $cache_dir = null ][, Filesystem $filesystem = new NativeLocalFilesystem() ][, Serializer $serializer = new NativePHPSerializer() ]) : FilesystemCache
Parameters
$cache_dir : Path|string|null = null
$filesystem : Filesystem = new NativeLocalFilesystem()
$serializer : Serializer = new NativePHPSerializer()
Return values
FilesystemCache

from_sequence_date_period()

from_sequence_date_period(string $entry_name, DateTimeInterface $start, DateInterval $interval, DateTimeInterface $end[, int $options = 0 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : DateTimeInterface
$interval : DateInterval
$end : DateTimeInterface
$options : int = 0
Return values
SequenceExtractor

from_sequence_date_period_recurrences()

from_sequence_date_period_recurrences(string $entry_name, DateTimeInterface $start, DateInterval $interval, int $recurrences[, int $options = 0 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : DateTimeInterface
$interval : DateInterval
$recurrences : int
$options : int = 0
Return values
SequenceExtractor

from_sequence_number()

from_sequence_number(string $entry_name, string|int|float $start, string|int|float $end[, int|float $step = 1 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : string|int|float
$end : string|int|float
$step : int|float = 1
Return values
SequenceExtractor

to_array()

Convert rows to an array and store them in passed array variable.

to_array(array<string|int, mixed> &$array) : ArrayLoader
Parameters
$array : array<string|int, mixed>
Tags
param-out

array<array> $array

Return values
ArrayLoader

to_stream()

to_stream(string $uri[, int|bool $truncate = 20 ][, Output $output = Output::rows ][, string $mode = 'w' ][, Formatter $formatter = new AsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
$uri : string
$truncate : int|bool = 20
$output : Output = Output::rows
$mode : string = 'w'
$formatter : Formatter = new AsciiTableFormatter()
$schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoader

bool_entry()

bool_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, bool|null>
Parameters
$name : string
$value : bool|null
$metadata : Metadata|null = null
Return values
Entry<string|int, bool|null>

boolean_entry()

boolean_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, bool|null>
Parameters
$name : string
$value : bool|null
$metadata : Metadata|null = null
Return values
Entry<string|int, bool|null>

datetime_entry()

datetime_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, DateTimeInterface|null>
Parameters
$name : string
$value : DateTimeInterface|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, DateTimeInterface|null>

time_entry()

time_entry(string $name, DateInterval|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, DateInterval|null>
Parameters
$name : string
$value : DateInterval|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, DateInterval|null>

date_entry()

date_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, DateTimeInterface|null>
Parameters
$name : string
$value : DateTimeInterface|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, DateTimeInterface|null>

int_entry()

int_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, int|null>
Parameters
$name : string
$value : int|null
$metadata : Metadata|null = null
Return values
Entry<string|int, int|null>

integer_entry()

integer_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, int|null>
Parameters
$name : string
$value : int|null
$metadata : Metadata|null = null
Return values
Entry<string|int, int|null>

enum_entry()

enum_entry(string $name, UnitEnum|null $enum[, Metadata|null $metadata = null ]) : Entry<string|int, UnitEnum|null>
Parameters
$name : string
$enum : UnitEnum|null
$metadata : Metadata|null = null
Return values
Entry<string|int, UnitEnum|null>

float_entry()

float_entry(string $name, float|int|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, float|null>
Parameters
$name : string
$value : float|int|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, float|null>

json_entry()

json_entry(string $name, null|array<string|int, mixed>|Json|string $data[, Metadata|null $metadata = null ]) : Entry<string|int, Json|null>
Parameters
$name : string
$data : null|array<string|int, mixed>|Json|string
$metadata : Metadata|null = null
Return values
Entry<string|int, Json|null>

json_object_entry()

json_object_entry(string $name, null|array<string|int, mixed>|Json|string $data[, Metadata|null $metadata = null ]) : Entry<string|int, Json|null>
Parameters
$name : string
$data : null|array<string|int, mixed>|Json|string
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
Entry<string|int, Json|null>

str_entry()

str_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, string|null>
Parameters
$name : string
$value : string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, string|null>

null_entry()

This functions is an alias for creating string entry from null.

null_entry(string $name[, Metadata|null $metadata = null ]) : Entry<string|int, string|null>

The main difference between using this function an simply str_entry with second argument null is that this function will also keep a note in the metadata that type might not be final. For example when we need to guess column type from rows because schema was not provided, and given column in the first row is null, it might still change once we get to the second row. That metadata is used to determine if string_entry was created from null or not.

By design flow assumes when guessing column type that null would be a string (the most flexible type).

Parameters
$name : string
$metadata : Metadata|null = null
Return values
Entry<string|int, string|null>

string_entry()

string_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, string|null>
Parameters
$name : string
$value : string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, string|null>

uuid_entry()

uuid_entry(string $name, Uuid|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, Uuid|null>
Parameters
$name : string
$value : Uuid|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, Uuid|null>

xml_entry()

xml_entry(string $name, DOMDocument|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, DOMDocument|null>
Parameters
$name : string
$value : DOMDocument|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, DOMDocument|null>

xml_element_entry()

xml_element_entry(string $name, DOMElement|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, DOMElement|null>
Parameters
$name : string
$value : DOMElement|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, DOMElement|null>

html_entry()

html_entry(string $name, HTMLDocument|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, HTMLDocument|null>
Parameters
$name : string
$value : HTMLDocument|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, HTMLDocument|null>

html_element_entry()

html_element_entry(string $name, HTMLElement|string|null $value[, Metadata|null $metadata = null ]) : Entry<string|int, HTMLElement|null>
Parameters
$name : string
$value : HTMLElement|string|null
$metadata : Metadata|null = null
Return values
Entry<string|int, HTMLElement|null>

struct_entry()

struct_entry(string $name, array<string, mixed>|null $value, StructureType<string|int, T$type[, Metadata|null $metadata = null ]) : Entry<string|int, array<string, T>|null>
Parameters
$name : string
$value : array<string, mixed>|null
$type : StructureType<string|int, T>
$metadata : Metadata|null = null
Tags
template
Return values
Entry<string|int, array<string, T>|null>

structure_entry()

structure_entry(string $name, array<string, mixed>|null $value, StructureType<string|int, T$type[, Metadata|null $metadata = null ]) : Entry<string|int, array<string, T>|null>
Parameters
$name : string
$value : array<string, mixed>|null
$type : StructureType<string|int, T>
$metadata : Metadata|null = null
Tags
template
Return values
Entry<string|int, array<string, T>|null>

list_entry()

list_entry(string $name, null|array<int, mixed> $value, ListType<string|int, T$type[, Metadata|null $metadata = null ]) : Entry<string|int, mixed>
Parameters
$name : string
$value : null|array<int, mixed>
$type : ListType<string|int, T>
$metadata : Metadata|null = null
Tags
template
Return values
Entry<string|int, mixed>

map_entry()

map_entry(string $name, array<string|int, mixed>|null $value, MapType<TKey, TValue$mapType[, Metadata|null $metadata = null ]) : Entry
Parameters
$name : string
$value : array<string|int, mixed>|null
$mapType : MapType<TKey, TValue>
$metadata : Metadata|null = null
Tags
template
template
Return values
Entry

rows_partitioned()

rows_partitioned(array<string|int, Row$rows, array<string|int, Partition|string>|Partitions $partitions) : Rows
Parameters
$rows : array<string|int, Row>
$partitions : array<string|int, Partition|string>|Partitions
Return values
Rows

mask_columns()

mask_columns([array<int, string> $columns = [] ][, string $mask = '******' ]) : MaskColumns
Parameters
$columns : array<int, string> = []
$mask : string = '******'
Return values
MaskColumns

when()

when(mixed $condition, mixed $then[, mixed $else = null ]) : When
Parameters
$condition : mixed
$then : mixed
$else : mixed = null
Return values
When

cast()

cast(mixed $value, Type<string|int, mixed>|string $type) : Cast
Parameters
$value : mixed
$type : Type<string|int, mixed>|string
Return values
Cast

call()

Calls a user-defined function with the given parameters.

call(callable|ScalarFunction $callable[, array<string|int, mixed> $parameters = [] ][, null|Type<string|int, mixed> $return_type = null ]) : CallUserFunc
Parameters
$callable : callable|ScalarFunction
$parameters : array<string|int, mixed> = []
$return_type : null|Type<string|int, mixed> = null
Return values
CallUserFunc

array_expand()

Expands each value into entry, if there are more than one value, multiple rows will be created.

array_expand(ScalarFunction $function[, ArrayExpand $expand = ArrayExpand::VALUES ]) : ArrayExpand

Array keys are ignored, only values are used to create new rows.

Before: +--+-------------------+ |id| array| +--+-------------------+ | 1|{"a":1,"b":2,"c":3}| +--+-------------------+

After: +--+--------+ |id|expanded| +--+--------+ | 1| 1| | 1| 2| | 1| 3| +--+--------+

Parameters
$function : ScalarFunction
$expand : ArrayExpand = ArrayExpand::VALUES
Return values
ArrayExpand

to_entry()

to_entry(string $name, array<string|int, mixed> $data, EntryFactory $entryFactory) : Entry<string|int, mixed>
Parameters
$name : string
$data : array<string|int, mixed>
$entryFactory : EntryFactory
Return values
Entry<string|int, mixed>

array_to_row()

array_to_row(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data, EntryFactory $entryFactory[, array<string|int, Partition>|Partitions $partitions = [] ][, null|Schema $schema = null ]) : Row
Parameters
$data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
$entryFactory : EntryFactory
$partitions : array<string|int, Partition>|Partitions = []
$schema : null|Schema = null
Return values
Row

array_to_rows()

array_to_rows(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data, EntryFactory $entryFactory[, array<string|int, Partition>|Partitions $partitions = [] ][, null|Schema $schema = null ]) : Rows
Parameters
$data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
$entryFactory : EntryFactory
$partitions : array<string|int, Partition>|Partitions = []
$schema : null|Schema = null
Return values
Rows

schema_to_json()

schema_to_json(Schema $schema[, bool $pretty = false ]) : string
Parameters
$schema : Schema
$pretty : bool = false
Return values
string

schema_from_json()

schema_from_json(string $schema) : Schema
Parameters
$schema : string
Return values
Schema

schema_metadata()

schema_metadata([array<string, array<string|int, bool|float|int|string>|bool|float|int|string> $metadata = [] ]) : Metadata
Parameters
$metadata : array<string, array<string|int, bool|float|int|string>|bool|float|int|string> = []
Return values
Metadata

map_schema()

map_schema(string $name, MapType|Type $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : MapDefinition<TKey, TValue>
Parameters
$name : string
$type : MapType|Type
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
template
Return values
MapDefinition<TKey, TValue>

list_schema()

list_schema(string $name, ListType<string|int, T>|Type<string|int, array<int, T>> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : ListDefinition<string|int, T>
Parameters
$name : string
$type : ListType<string|int, T>|Type<string|int, array<int, T>>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
ListDefinition<string|int, T>

enum_schema()

enum_schema(string $name, T> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : EnumDefinition<string|int, T>
Parameters
$name : string
$type : T>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
EnumDefinition<string|int, T>

structure_schema()

structure_schema(string $name, StructureType<string|int, T>|Type<string|int, array<string, T>> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : StructureDefinition<string|int, T>
Parameters
$name : string
$type : StructureType<string|int, T>|Type<string|int, array<string, T>>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
StructureDefinition<string|int, T>

definition_from_array()

Create a Definition from an array representation.

definition_from_array(array<string|int, mixed> $definition) : Definition<string|int, mixed>
Parameters
$definition : array<string|int, mixed>
Return values
Definition<string|int, mixed>

definition_from_type()

Create a Definition from a Type.

definition_from_type(string|Reference $ref, Type<string|int, mixed> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition<string|int, mixed>
Parameters
$ref : string|Reference
$type : Type<string|int, mixed>
$nullable : bool = false
$metadata : Metadata|null = null
Return values
Definition<string|int, mixed>

execution_strict()

In this mode, functions throws exceptions if the given entry is not found or passed parameters are invalid.

execution_strict() : ExecutionMode
Return values
ExecutionMode

print_rows()

print_rows(Rows $rows[, int|bool $truncate = false ][, Formatter|null $formatter = null ]) : string
Parameters
$rows : Rows
$truncate : int|bool = false
$formatter : Formatter|null = null
Return values
string

is_type()

is_type(array<string|int, string|Type<string|int, mixed>>|Type<string|int, mixed> $type, mixed $value) : bool
Parameters
$type : array<string|int, string|Type<string|int, mixed>>|Type<string|int, mixed>
$value : mixed
Return values
bool

date_interval_to_milliseconds()

date_interval_to_milliseconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

date_interval_to_seconds()

date_interval_to_seconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

date_interval_to_microseconds()

date_interval_to_microseconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

retry_on_exception_types()

retry_on_exception_types(array<string|int, Throwable>$exception_types, int $limit) : OnExceptionTypes
Parameters
$exception_types : array<string|int, Throwable>>
$limit : int
Return values
OnExceptionTypes

delay_jitter()

delay_jitter(DelayFactory $delay, float $jitter_factor) : Jitter
Parameters
$delay : DelayFactory
$jitter_factor : float

a value between 0 and 1 representing the maximum percentage of jitter to apply

Return values
Jitter

duration_milliseconds()

duration_milliseconds(int $milliseconds) : Duration
Parameters
$milliseconds : int
Return values
Duration

duration_microseconds()

duration_microseconds(int $microseconds) : Duration
Parameters
$microseconds : int
Return values
Duration

clock()

clock([string $time_zone = 'UTC' ]) : ClockInterface
Parameters
$time_zone : string = 'UTC'
Return values
ClockInterface

        
On this page

Search results