Dotclear 2.24
|
Query Result Record Class. More...
Public Member Functions | |
__construct ($result, array $info) | |
toStatic () | |
__call (string $f, $args) | |
__get ($n) | |
f ($n) | |
field ($n) | |
exists ($n) | |
__isset (string $n) | |
extend (string $class) | |
extensions () | |
index (?int $row=null) | |
fetch () | |
moveStart () | |
moveEnd () | |
moveNext () | |
movePrev () | |
isEnd () | |
isStart () | |
isEmpty () | |
count () | |
columns () | |
rows () | |
row () | |
current () | |
key () | |
next () | |
rewind () | |
valid () | |
Protected Member Functions | |
getData () | |
Protected Attributes | |
$__link | |
$__result | |
$__info | |
$__extend = [] | |
$__index = 0 | |
$__row = false | |
Query Result Record Class.
This class acts as an iterator over database query result. It does not fetch all results on instantiation and thus, depending on database engine, should not fill PHP process memory.
__construct | ( | $result, | |
array | $info | ||
) |
Constructor
Creates class instance from result link and some informations. $info is an array with the following content:
mixed | $result | Resource result |
array | $info | Information array |
References index().
toStatic | ( | ) |
To staticRecord
Converts this record to a staticRecord
instance.
__call | ( | string | $f, |
$args | |||
) |
Magic call
Magic call function. Calls function added by extend()
if exists, passing it self object and arguments.
string | $f | Function name |
mixed | $args | Arguments |
__get | ( | $n | ) |
f | ( | $n | ) |
field | ( | $n | ) |
Get field
Retrieve field value by its name or column position.
string | int | $n | Field name or field position |
Reimplemented in staticRecord.
exists | ( | $n | ) |
Field exists
Returns true if a field exists.
string | $n | Field name |
Reimplemented in staticRecord.
__isset | ( | string | $n | ) |
Field isset
Returns true if a field exists (magic method from PHP 5.1).
string | $n | Field name |
extend | ( | string | $class | ) |
Extend record
Extends this instance capabilities by adding all public static methods of $class to current instance. Class methods should take at least this record as first parameter.
string | $class | Class name |
extensions | ( | ) |
index | ( | ?int | $row = null | ) |
Returns the current index position (0 is first) or move to $row if specified.
int | $row | Row number to move |
Reimplemented in staticRecord.
References $__index.
Referenced by __construct(), fetch(), key(), moveEnd(), moveNext(), movePrev(), and moveStart().
fetch | ( | ) |
moveStart | ( | ) |
moveEnd | ( | ) |
moveNext | ( | ) |
movePrev | ( | ) |
isEnd | ( | ) |
References count().
isStart | ( | ) |
isEmpty | ( | ) |
References count().
count | ( | ) |
Referenced by getData(), isEmpty(), isEnd(), and staticRecord\newFromArray().
columns | ( | ) |
rows | ( | ) |
|
protected |
row | ( | ) |
References $__row.
current | ( | ) |
key | ( | ) |
References index().
next | ( | ) |
References fetch().
rewind | ( | ) |
References fetch(), and moveStart().
valid | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by extensions().
|
protected |
Referenced by fetch(), staticRecord\field(), index(), staticRecord\index(), and staticRecord\set().
|
protected |
Referenced by row().