Flow PHP

functions.php

Functions

from_dbal_limit_offset()

from_dbal_limit_offset(Connection $connection, string|Table $table, array<string|int, OrderBy>|OrderBy $order_by[, int $page_size = 1000 ][, null|int $maximum = null ]) : DbalLimitOffsetExtractor
Parameters
$connection : Connection
$table : string|Table
$order_by : array<string|int, OrderBy>|OrderBy
$page_size : int = 1000
  • becomes the extractor's batch size: rows per page
$maximum : null|int = null
Tags
throws
InvalidArgumentException
Return values
DbalLimitOffsetExtractor

from_dbal_limit_offset_qb()

from_dbal_limit_offset_qb(Connection $connection, QueryBuilder $queryBuilder[, int $page_size = 1000 ][, null|int $maximum = null ][, int $offset = 0 ]) : DbalLimitOffsetExtractor
Parameters
$connection : Connection
$queryBuilder : QueryBuilder
$page_size : int = 1000
  • becomes the extractor's batch size: rows per page
$maximum : null|int = null
  • maximum can also be taken from a query builder, $maximum however is used regardless of the query builder if it's set
$offset : int = 0
  • offset can also be taken from a query builder, $offset however is used regardless of the query builder if it's set to non 0 value
Return values
DbalLimitOffsetExtractor

from_dbal_queries()

from_dbal_queries(Connection $connection, string $query[, null|ParametersSet $parameters_set = null ][, array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> $types = [] ]) : DbalQueryExtractor
Parameters
$connection : Connection
$query : string
$parameters_set : null|ParametersSet = null
  • each one parameters array will be evaluated as new query
$types : array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> = []
Return values
DbalQueryExtractor

dbal_from_queries()

use from_dbal_queries() instead

dbal_from_queries(Connection $connection, string $query[, null|ParametersSet $parameters_set = null ][, array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> $types = [] ]) : DbalQueryExtractor
Parameters
$connection : Connection
$query : string
$parameters_set : null|ParametersSet = null
  • each one parameters array will be evaluated as new query
$types : array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> = []
Return values
DbalQueryExtractor

from_dbal_query()

from_dbal_query(Connection $connection, string $query[, array<string, mixed>|array<int, mixed> $parameters = [] ][, array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> $types = [] ]) : DbalQueryExtractor
Parameters
$connection : Connection
$query : string
$parameters : array<string, mixed>|array<int, mixed> = []
  • @deprecated use DbalQueryExtractor::withParameters() instead
$types : array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> = []
  • @deprecated use DbalQueryExtractor::withTypes() instead
Return values
DbalQueryExtractor

dbal_from_query()

use from_dbal_query() instead

dbal_from_query(Connection $connection, string $query[, array<string, mixed>|array<int, mixed> $parameters = [] ][, array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> $types = [] ]) : DbalQueryExtractor
Parameters
$connection : Connection
$query : string
$parameters : array<string, mixed>|array<int, mixed> = []
  • @deprecated use DbalQueryExtractor::withParameters() instead
$types : array<int<0, max>|string, ArrayParameterType|ParameterType|Type|string> = []
  • @deprecated use DbalQueryExtractor::withTypes() instead
Return values
DbalQueryExtractor

to_dbal_table_insert()

Insert new rows into a database table.

to_dbal_table_insert(array<string, mixed>|Connection $connection, string $table[, InsertOptions|null $options = null ]) : DbalLoader

Insert can also be used as an upsert with the help of InsertOptions. InsertOptions are platform specific, so please choose the right one for your database.

  • MySQLInsertOptions
  • PostgreSQLInsertOptions
  • SqliteInsertOptions

In order to control the size of the single insert, use DataFrame::chunkSize() method just before calling DataFrame::load().

Parameters
$connection : array<string, mixed>|Connection
$table : string
$options : InsertOptions|null = null
Tags
throws
InvalidArgumentException
Return values
DbalLoader

to_dbal_table_update()

Update existing rows in database.

to_dbal_table_update(array<string, mixed>|Connection $connection, string $table[, UpdateOptions|null $options = null ]) : DbalLoader

In order to control the size of the single request, use DataFrame::chunkSize() method just before calling DataFrame::load().

Parameters
$connection : array<string, mixed>|Connection
$table : string
$options : UpdateOptions|null = null
Tags
throws
InvalidArgumentException
Return values
DbalLoader

to_dbal_table_delete()

Delete rows from database table based on the provided data.

to_dbal_table_delete(array<string, mixed>|Connection $connection, string $table) : DbalLoader

In order to control the size of the single request, use DataFrame::chunkSize() method just before calling DataFrame::load().

Parameters
$connection : array<string, mixed>|Connection
$table : string
Tags
throws
InvalidArgumentException
Return values
DbalLoader

to_dbal_schema_table()

Converts a Flow\ETL\Schema to a Doctrine\DBAL\Schema\Table.

to_dbal_schema_table(Schema $schema, string $table_name[, array<string, mixed> $table_options = [] ][, array<string|int, mixed> $types_map = [] ]) : Table
Parameters
$schema : Schema
$table_name : string
$table_options : array<string, mixed> = []
$types_map : array<string|int, mixed> = []
Return values
Table

table_schema_to_flow_schema()

Converts a Doctrine\DBAL\Schema\Table to a Flow\ETL\Schema.

table_schema_to_flow_schema(Table $table[, array<string|int, mixed> $types_map = [] ]) : Schema
Parameters
$table : Table
$types_map : array<string|int, mixed> = []
Return values
Schema

postgresql_insert_options()

postgresql_insert_options([bool|null $skip_conflicts = null ][, string|null $constraint = null ][, array<string|int, string> $conflict_columns = [] ][, array<string|int, string> $update_columns = [] ]) : PostgreSQLInsertOptions
Parameters
$skip_conflicts : bool|null = null
$constraint : string|null = null
$conflict_columns : array<string|int, string> = []
$update_columns : array<string|int, string> = []
Return values
PostgreSQLInsertOptions

mysql_insert_options()

mysql_insert_options([bool|null $skip_conflicts = null ][, bool|null $upsert = null ][, array<string|int, string> $update_columns = [] ]) : MySQLInsertOptions
Parameters
$skip_conflicts : bool|null = null
$upsert : bool|null = null
$update_columns : array<string|int, string> = []
Return values
MySQLInsertOptions

sqlite_insert_options()

sqlite_insert_options([bool|null $skip_conflicts = null ][, array<string|int, string> $conflict_columns = [] ][, array<string|int, string> $update_columns = [] ]) : SqliteInsertOptions
Parameters
$skip_conflicts : bool|null = null
$conflict_columns : array<string|int, string> = []
$update_columns : array<string|int, string> = []
Return values
SqliteInsertOptions

postgresql_update_options()

postgresql_update_options([array<string|int, string> $primary_key_columns = [] ][, array<string|int, string> $update_columns = [] ]) : PostgreSQLUpdateOptions
Parameters
$primary_key_columns : array<string|int, string> = []
$update_columns : array<string|int, string> = []
Return values
PostgreSQLUpdateOptions

to_dbal_transaction()

Execute multiple loaders within database transactions.

to_dbal_transaction(array<string, mixed>|Connection $connection, Loader ...$loaders) : TransactionalDbalLoader

Each batch of rows is loaded in its own transaction; rows a wrapped Transformation delivers when the loader is closed (blocking operations drain there) are committed in one final transaction. If any loader fails, the open transaction is rolled back. Atomicity requires every wrapped loader to use the same connection as the wrapper: pass one live Connection to both - a wrapped loader built from array params opens its own connection and escapes the transaction.

Parameters
$connection : array<string, mixed>|Connection
$loaders : Loader
  • Loaders to execute within the transaction
Tags
throws
InvalidArgumentException
Return values
TransactionalDbalLoader

pagination_key_asc()

pagination_key_asc(string $column[, string|ParameterType|Type $type = ParameterType::STRING ]) : Key
Parameters
$column : string
$type : string|ParameterType|Type = ParameterType::STRING
Return values
Key

pagination_key_desc()

pagination_key_desc(string $column[, string|ParameterType|Type $type = ParameterType::STRING ]) : Key
Parameters
$column : string
$type : string|ParameterType|Type = ParameterType::STRING
Return values
Key
On this page

Search results