\Gishiki\Database\RuntimeResultModifier

An helper class used to modify the result set of a database read operation.

Summary

Methods
Properties
Constants
initialize()
__construct()
order()
limit()
skip()
No public properties found
No constants found
No protected methods found
$skip
$limit
$orderColumns
N/A
export()
No private properties found
N/A

Properties

$skip

$skip : integer

Type

integer — the number of rows to be discarded

$limit

$limit : integer

Type

integer — the limit of rows to be fetched

$orderColumns

$orderColumns : array

Type

array — a list of columns with the respective order

Methods

initialize()

initialize(array|null  $init = null) : \self

Initialize a new result modifier using the initializer data.

$resultFilter = ResultModifier::initialize([ 'limit' => 5, 'skip' => 8, 'name' => FieldOrdering::ASC ]);

Parameters

array|null $init

the initializer data

Throws

\InvalidArgumentException

the initializer data is not valid

Returns

\self —

the initialized result modifier

__construct()

__construct() 

Create a new result modifier that acts as "no filters".

order()

order(string  $field, integer  $order) : \Gishiki\Database\Runtime\ResultModifier

Change the order of elements in the result set.

Parameters

string $field

the name of the field to be used for ordering

integer $order

the order to be applied (one of FieldOrdering consts)

Throws

\InvalidArgumentException

passed input is not valid or incompatible type

Returns

\Gishiki\Database\Runtime\ResultModifier

the modified filter

limit()

limit(integer  $limit = -1) : \Gishiki\Database\Runtime\ResultModifier

Change the limit of the elements in the result set.

Parameters

integer $limit

the maximum number of results that can be fetched from the database

Throws

\InvalidArgumentException

passed input is not valid or incompatible type

Returns

\Gishiki\Database\Runtime\ResultModifier

the modified filter

skip()

skip(integer  $offset = -1) : \Gishiki\Database\Runtime\ResultModifier

Change the offset of elements in the result set.

Parameters

integer $offset

the offset to be applied

Throws

\InvalidArgumentException

passed input is not valid or incompatible type

Returns

\Gishiki\Database\Runtime\ResultModifier

the modified filter

export()

export()