Skip to content
Search

Building Blocks

Back

Entries are the columns of the Data Frame, they are represented by the Entry interface. Group of Entries is called Row, it is represented by the Row class. Group of Rows is called Rows, it is represented by the Rows class.

Let's look at the following example:

<?php

declare(strict_types=1);

use function Flow\ETL\DSL\{bool_entry, int_entry, row, rows, str_entry};

$rows = rows(
    row(int_entry('id', 1), str_entry('name', 'user_01'), bool_entry('active', true)),
    row(int_entry('id', 2), str_entry('name', 'user_02'), bool_entry('active', false)),
    row(int_entry('id', 3), str_entry('name', 'user_03'), bool_entry('active', true)),
    row(int_entry('id', 3), str_entry('name', 'user_04'), bool_entry('active', false)),
);

Rows are the main data structure in Flow ETL, they’re used to represent data in the data frame. Extractors are yielding Rows and Loaders are saving Rows.

The same can be achieved using the following code:

<?php

declare(strict_types=1);

use function Flow\ETL\DSL\array_to_rows;

$rows = array_to_rows([
    ['id' => 1, 'name' => 'user_01', 'active' => true],
    ['id' => 2, 'name' => 'user_02', 'active' => false],
    ['id' => 3, 'name' => 'user_03', 'active' => true],
    ['id' => 4, 'name' => 'user_04', 'active' => false],
], flow_context(config())->entryFactory());

Entry Types

Internally, Flow is using EntryFactory to create entries. It will try to detect and create the most appropriate entry type based on the value.

Flow Entries are based on Flow Types Library

Found a typo or an outdated section? Edit this page on GitHub


Contributors

Built in the open.

Join us on GitHub
scroll back to top