.

DBResultSet Class Reference
[Model]

Result set. More...

Inheritance diagram for DBResultSet:
IDBResultSet

List of all members.

Public Member Functions

  __construct ($pdo)
  close ()
  Closes internal cursor.
  fetch ()
  Returns row as associative array.
  get_column_count ()
  Returns number of columns in result set.
  get_row_count ()
  Returns number of rows in result set.
  get_status ()
  Returns status.

Protected Attributes

  $pdo_statement = null

Detailed Description

Result set.

Author:
Gerd Riesselmann

Definition at line 8 of file dbresultset.cls.php.


Constructor & Destructor Documentation

DBResultSet::__construct ( pdo  ) 

Definition at line 16 of file dbresultset.cls.php.

00016                                           {
00017                 $this->pdo_statement = $pdo;
00018         }

Member Function Documentation

DBResultSet::close (  ) 

Closes internal cursor.

Returns:
void

Implements IDBResultSet.

Definition at line 25 of file dbresultset.cls.php.

00025                                 {
00026                 $this->pdo_statement->closeCursor();
00027         }
DBResultSet::fetch (  ) 

Returns row as associative array.

Returns:
array | bool False if no more data is available

Implements IDBResultSet.

Definition at line 52 of file dbresultset.cls.php.

00052                                 {
00053                 return $this->pdo_statement->fetch(PDO::FETCH_ASSOC);
00054         }
DBResultSet::get_column_count (  ) 

Returns number of columns in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 34 of file dbresultset.cls.php.

00034                                            {
00035                 return $this->pdo_statement->columnCount();
00036         }
DBResultSet::get_row_count (  ) 

Returns number of rows in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 43 of file dbresultset.cls.php.

00043                                         {
00044                 return $this->pdo_statement->rowCount();
00045         }
DBResultSet::get_status (  ) 

Returns status.

Parameters:
Status 

Implements IDBResultSet.

Definition at line 61 of file dbresultset.cls.php.

00061                                      {
00062                 $ret = new Status();
00063                 $stub = substr($this->pdo_statement->errorCode(), 0, 2);
00064                 switch ($stub) {
00065                         case '00':
00066                                 // No error
00067                                 break;
00068                         case '01':
00069                         case 'IM':
00070                                 // Warnings
00071                                 break;
00072                         default:
00073                                 $info = $this->pdo_statement->errorInfo();
00074                                 $ret->append($info[2]);
00075                                 break;
00076                 }
00077                 return $ret;
00078         }

Member Data Documentation

DBResultSet::$pdo_statement = null [protected]

Definition at line 14 of file dbresultset.cls.php.


The documentation for this class was generated from the following file: