\RedBeanPHP\CursorPDOCursor

PDO Database Cursor Implementation of PDO Database Cursor.

Used by the BeanCollection to fetch one bean at a time. The PDO Cursor is used by Query Writers to support retrieval of large bean collections. For instance, this class is used to implement the findCollection()/BeanCollection functionality.

Summary

Methods
Properties
Constants
__construct()
getNextItem()
reset()
close()
No public properties found
No constants found
No protected methods found
$res
$fetchStyle
N/A
No private methods found
No private properties found
N/A

Properties

$res

$res : \RedBeanPHP\Cursor\PDOStatement

Type

\RedBeanPHP\Cursor\PDOStatement

$fetchStyle

$fetchStyle : string

Type

string

Methods

__construct()

__construct(\RedBeanPHP\Cursor\PDOStatement  $res, string  $fetchStyle) : void

Constructor, creates a new instance of a PDO Database Cursor.

Parameters

\RedBeanPHP\Cursor\PDOStatement $res

the PDO statement

string $fetchStyle

fetch style constant to use

getNextItem()

getNextItem() : array

Should retrieve the next row of the result set.

This method is used to iterate over the result set.

Returns

array

reset()

reset() : void

Resets the cursor by closing it and re-executing the statement.

This reloads fresh data from the database for the whole collection.

close()

close() : void

Closes the database cursor.

Some databases require a cursor to be closed before executing another statement/opening a new cursor.