Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The DB_Recordset class

• Introduction

Database recordset.

• Class synopsis

DB_Recordset implements DB_iRecordset {
/* Properties */
// Contains internal pointer position
protected int $position;
// Contains current record
protected mixed $record;
// MySQL query result resource
protected resource $resource;
// Contains result type
protected int $resultType = 0;
/* Methods */
// Constructor.
public __construct ( resource $resource, [ int $resultType = MYSQL_ASSOC ] ) returns DB_Recordset;
// Destructor.
public __destruct ( ) returns void;
// Countable::count() implementation.
public count ( ) returns int;
// Returns the current element.
public current ( ) returns array;
// Returns the key of the current element.
public key ( ) returns mixed;
// Move forward to next element.
public next ( ) returns void;
// Rewinds the Iterator to the first element.
public rewind ( ) returns void;
// SeekableIterator::seek() implementation.
public seek ( int $position ) returns bool;
// Checks if current position is valid.
public valid ( ) returns bool;
// Cloninig.
public __clone ( ) returns void;
}

• Class Properies

protected int $position

Contains internal pointer position

protected mixed $record

Contains current record

protected resource $resource

MySQL query result resource

protected int $resultType

Contains result type

• Class Methods

// Constructor.
public __construct ( resource $resource, [ int $resultType = MYSQL_ASSOC ] ) returns DB_Recordset;
  • resource $resource
    MySQL query result resource
  • int $resultType
    See mysql_fetch_array $result_type parameter description

Overridden in child classes as: DB_Recordset_Column::__construct().

// Destructor.
public __destruct ( ) returns void;
// Countable::count() implementation.
public count ( ) returns int;
Counts elements of an object.
// Returns the current element.
public current ( ) returns array;

Overridden in child classes as: DB_Recordset_Column::current().

Iterator interface implementation.
// Returns the key of the current element.
public key ( ) returns mixed;
Iterator interface implementation.
// Move forward to next element.
public next ( ) returns void;
Iterator interface implementation.
// Rewinds the Iterator to the first element.
public rewind ( ) returns void;
Iterator interface implementation.
// SeekableIterator::seek() implementation.
public seek ( int $position ) returns bool;
  • int $position
    The position to seek to
Seeks to a position.
// Checks if current position is valid.
public valid ( ) returns bool;
Iterator interface implementation.
// Cloninig.
public __clone ( ) returns void;