Flow PHP

DbalKeySetExtractor implements Extractor

FinalYes

Extractor implementing keyset pagination for Doctrine DBAL queries.

This extractor fetches rows page by page using keyset pagination, which is more efficient than limit/offset for large datasets. It requires a KeySet object defining the columns and sort orders for pagination. The key columns must be non-null and provide a unique ordering to ensure correct pagination.

Interfaces

Extractor

Methods

__construct()  : mixed
extract()  : Generator
withKeyAliasSuffix()  : self
withMaximum()  : $this
Sets the maximum number of rows to fetch.
withPageSize()  : $this
Sets the number of rows per page.
withSchema()  : $this
Sets the schema for the extracted rows.

Methods

__construct()

public __construct(Connection $connection, QueryBuilder $queryBuilder, KeySet $keySet) : mixed
Parameters
$connection : Connection
$queryBuilder : QueryBuilder
$keySet : KeySet

extract()

public extract(FlowContext $context) : Generator
Parameters
$context : FlowContext
Return values
Generator

withKeyAliasSuffix()

public withKeyAliasSuffix(string $keyAliasSuffix) : self
Parameters
$keyAliasSuffix : string
Return values
self

withMaximum()

Sets the maximum number of rows to fetch.

public withMaximum(int $maximum) : $this
Parameters
$maximum : int

the maximum number of rows (must be > 0)

Tags
throws
InvalidArgumentException

if maximum is <= 0

Return values
$this

withPageSize()

Sets the number of rows per page.

public withPageSize(int $pageSize) : $this
Parameters
$pageSize : int

the page size (must be > 0)

Tags
throws
InvalidArgumentException

if page size is <= 0

Return values
$this

withSchema()

Sets the schema for the extracted rows.

public withSchema(Schema $schema) : $this
Parameters
$schema : Schema

the schema to apply to rows

Return values
$this

        
On this page

Search results