Jelix 1.8.14-pre

jDbPDOResultSet7 extends PDOStatement
in package

a resultset based on PDOStatement, for PHP < 8.0.

Tags
subpackage

db

Table of Contents

$_fetchMode  : mixed
$modifier  : array<string|int, callable>
a callback function which will modify on the fly record's value.
addModifier()  : mixed
fetch()  : mixed
fetchAll()  : array<string|int, object>
return all results from the statement.
fetchAllAssociative()  : array<string|int, array<string|int, mixed>>
Return all results in an array. Each result is an associative array.
fetchAssociative()  : array<string|int, mixed>|bool
fetch a result. The result is returned as an associative array.
setFetchMode()  : bool
Set the fetch mode.
unescapeBin()  : string
applyModifiers()  : mixed

Properties

$modifier

a callback function which will modify on the fly record's value.

protected array<string|int, callable> $modifier = array()
Tags
since
1.1.6

Methods

addModifier()

public addModifier(callable $function) : mixed
Parameters
$function : callable

a callback function the function should accept in parameter the record, and the resulset object

Tags
since
1.1.6
Return values
mixed

fetch()

public fetch([mixed $fetch_style = null ][, mixed $cursor_orientation = PDO::FETCH_ORI_NEXT ], mixed $cursor_offset) : mixed
Parameters
$fetch_style : mixed = null
$cursor_orientation : mixed = PDO::FETCH_ORI_NEXT
$cursor_offset : mixed
Tags
Return values
mixed

fetchAll()

return all results from the statement.

public fetchAll([int $fetch_style = null ][, int $fetch_argument = null ][, array<string|int, mixed> $ctor_arg = null ]) : array<string|int, object>
Parameters
$fetch_style : int = null
$fetch_argument : int = null
$ctor_arg : array<string|int, mixed> = null
Tags
Return values
array<string|int, object>

list of object which contain all rows

fetchAllAssociative()

Return all results in an array. Each result is an associative array.

public fetchAllAssociative() : array<string|int, array<string|int, mixed>>
Tags
Return values
array<string|int, array<string|int, mixed>>

fetchAssociative()

fetch a result. The result is returned as an associative array.

public fetchAssociative() : array<string|int, mixed>|bool
Tags
Return values
array<string|int, mixed>|bool

result array or false if there is no more result

setFetchMode()

Set the fetch mode.

public setFetchMode(int $mode[, mixed $arg1 = null ][, mixed $arg2 = array() ]) : bool
Parameters
$mode : int

the mode, a PDO::FETCH_* constant

$arg1 : mixed = null

a parameter for the given mode

$arg2 : mixed = array()

a parameter for the given mode

Tags
Return values
bool

true if the fetch mode is ok

unescapeBin()

public unescapeBin(string $text) : string
Parameters
$text : string

a binary string to unescape

Tags
since
1.1.6
Return values
string

the unescaped string

applyModifiers()

protected applyModifiers(mixed $result) : mixed
Parameters
$result : mixed
Tags
Return values
mixed

Search results