\Horde_Db_Adapter_Base_Result

This class represents the result set of a SELECT query.

Summary

Methods
Properties
Constants
__construct()
__destruct()
rewind()
current()
key()
next()
valid()
fetch()
setFetchMode()
columnCount()
No public properties found
No constants found
_fetchArray()
_columnCount()
$_adapter
$_sql
$_arg1
$_arg2
$_result
$_current
$_index
$_eof
$_fetchMode
N/A
No private methods found
No private properties found
N/A

Properties

$_sql

$_sql : string

Type

string

$_arg1

$_arg1 : mixed

Type

mixed

$_arg2

$_arg2 : string

Type

string

$_result

$_result : resource

Result resource.

Type

resource

$_current

$_current : array

Current row.

Type

array

$_index

$_index : integer

Current offset.

Type

integer

$_eof

$_eof : boolean

Are we at the end of the result?

Type

boolean

$_fetchMode

$_fetchMode : 

Which kind of keys to use for results.

Type

Methods

__construct()

__construct(\Horde_Db_Adapter  $adapter, string  $sql, mixed  $arg1 = null, string  $arg2 = null) 

Constructor.

Parameters

\Horde_Db_Adapter $adapter

A driver instance.

string $sql

A SQL query.

mixed $arg1

Either an array of bound parameters or a query name.

string $arg2

If $arg1 contains bound parameters, the query name.

__destruct()

__destruct() 

Destructor.

rewind()

rewind() 

Implementation of the rewind() method for iterator.

current()

current() : array

Implementation of the current() method for Iterator.

Returns

array —

The current row, or null if no rows.

key()

key() : mixed

Implementation of the key() method for Iterator.

Returns

mixed —

The current row number (starts at 0), or null if no rows.

next()

next() : array|null

Implementation of the next() method for Iterator.

Returns

array|null —

The next row in the resultset or null if there are no more results.

valid()

valid() : boolean

Implementation of the valid() method for Iterator.

Returns

boolean —

Whether the iteration is valid.

fetch()

fetch(integer  $fetchmode = \Horde_Db::FETCH_ASSOC) 

Returns the current row and advances the recordset one row.

Parameters

integer $fetchmode

The default fetch mode for this result. One of the HordeDb::FETCH* constants.

setFetchMode()

setFetchMode(integer  $fetchmode) 

Sets the default fetch mode for this result.

Parameters

integer $fetchmode

One of the HordeDb::FETCH* constants.

columnCount()

columnCount() : integer

Returns the number of columns in the result set.

Returns

integer —

Number of columns.

_fetchArray()

_fetchArray() : array|boolean

Returns a row from a resultset.

Returns

array|boolean —

The next row in the resultset or false if there are no more results.

_columnCount()

_columnCount() : integer

Returns the number of columns in the result set.

Returns

integer —

Number of columns.