creole.common
[ class tree: creole.common ] [ index: creole.common ] [ all elements ]

Class: ResultSetCommon

Source Location: /creole/common/ResultSetCommon.php

Class Overview


This class implements many shared or common methods needed by resultset drivers.


Author(s):

Version:

  • $Revision: 1.6 $

Variables

Methods


Child classes:

MSSQLResultSet
MSSQL implementation of ResultSet.
MySQLResultSet
MySQL implementation of ResultSet class.
ODBCResultSetCommon
Base class for ODBC implementation of ResultSet.
OCI8ResultSet
Oracle (OCI8) implementation of ResultSet class.
PgSQLResultSet
PostgreSQL implementation of ResultSet.
SQLiteResultSet
SQLite implementation of ResultSet class.

Class Details

[line 53]
This class implements many shared or common methods needed by resultset drivers.

This class may (optionally) be extended by driver classes simply to make it easier to create driver classes. This is also useful in the early stages of Creole development as it means that API changes affect fewer files. As Creole matures/stabalizes having a common class may become less useful, as drivers may have their own ways of doing things (and we'll have a solid unit test framework to make sure drivers conform to the API described by the interfaces).

The get*() methods in this class will format values before returning them. Note that if they will return

  1. null
if the database returned
  1. NULL
which makes these functions easier to use than simply typecasting the values from the db. If the requested column does not exist than an exception (SQLException) will be thrown.

  1. $rs = $conn->executeQuery("SELECT MAX(stamp) FROM event", ResultSet::FETCHMODE_NUM);
  2. $rs->next();
  3.  
  4. $max_stamp = $rs->getTimestamp(1, "d/m/Y H:i:s");
  5. // $max_stamp will be date string or null if no MAX(stamp) was found
  6.  
  7. $max_stamp = $rs->getTimestamp("max(stamp)", "d/m/Y H:i:s");
  8. // will THROW EXCEPTION, because the resultset was fetched using numeric indexing




Tags:

abstract:  
version:  $Revision: 1.6 $
author:  Hans Lellelid <hans@xmpl.org>


[ Top ]


Class Variables

$conn =

[line 65]

DB connection.



Tags:

access:  protected

Type:   Connection


[ Top ]

$cursorPos =  0

[line 77]

The current cursor position (row number). First row is 0.



Tags:

access:  protected

Type:   int


[ Top ]

$fetchmode =

[line 59]

The fetchmode for this recordset.



Tags:

access:  protected

Type:   int


[ Top ]

$fields =

[line 83]

The current unprocessed record/row from the db.



Tags:

access:  protected

Type:   array


[ Top ]

$ignoreAssocCase =  false

[line 88]

Whether to convert assoc col case.



Tags:

access:  protected

Type:   mixed


[ Top ]

$result =

[line 71]

Resource identifier used for native result set handling.



Tags:

access:  protected

Type:   resource


[ Top ]



Class Methods


constructor __construct [line 93]

ResultSetCommon __construct( Connection $conn, mixed $result, [mixed $fetchmode = null])



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


Overridden in child classes as:

ODBCResultSetCommon::__construct()
ODBCCachedResultSet::__construct()
ODBCResultSet::__construct()

[ Top ]

destructor __destruct [line 110]

void __destruct( )

Destructor

Free db result resource.




Tags:

access:  public


[ Top ]

method absolute [line 197]

void absolute( mixed $pos)



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method afterLast [line 245]

void afterLast( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method beforeFirst [line 236]

void beforeFirst( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method first [line 216]

void first( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method get [line 286]

void get( mixed $column)



Tags:

access:  public
see:  ResultSet::get()


[ Top ]

method getArray [line 296]

void getArray( mixed $column)



Tags:

access:  public
see:  ResultSet::getArray()


Overridden in child classes as:

PgSQLResultSet::getArray()
Reads a column as an array.

[ Top ]

method getBlob [line 318]

void getBlob( mixed $column)



Tags:

access:  public
see:  ResultSet::getBlob()


Overridden in child classes as:

ODBCResultSet::getBlob()
PgSQLResultSet::getBlob()
Returns Blob with contents of column value.
SQLiteResultSet::getBlob()
Performs sqlite_udf_decode_binary on binary data.

[ Top ]

method getBoolean [line 307]

void getBoolean( mixed $column)



Tags:

access:  public
see:  ResultSet::getBoolean()


Overridden in child classes as:

PgSQLResultSet::getBoolean()

[ Top ]

method getClob [line 332]

void getClob( mixed $column)



Tags:

access:  public
see:  ResultSet::getClob()


Overridden in child classes as:

ODBCResultSet::getClob()

[ Top ]

method getCursorPos [line 270]

void getCursorPos( )



Tags:

access:  public
see:  ResultSet::getCursorPos()


[ Top ]

method getDate [line 346]

void getDate( mixed $column, [mixed $format = '%x'])



Tags:

access:  public
see:  ResultSet::getDate()


[ Top ]

method getFetchmode [line 151]

void getFetchmode( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method getFloat [line 368]

void getFloat( mixed $column)



Tags:

access:  public
see:  ResultSet::getFloat()


[ Top ]

method getInt [line 379]

void getInt( mixed $column)



Tags:

access:  public
see:  ResultSet::getInt()


[ Top ]

method getIterator [line 118]

void getIterator( )



Tags:

access:  public
see:  ResultSet::getIterator()


Overridden in child classes as:

SQLiteResultSet::getIterator()
Gets optimized SQLiteResultSetIterator.

[ Top ]

method getResource [line 127]

void getResource( )



Tags:

access:  public
see:  ResultSet::getResource()


[ Top ]

method getRow [line 278]

void getRow( )



Tags:

access:  public
see:  ResultSet::getRow()


[ Top ]

method getString [line 390]

void getString( mixed $column)



Tags:

access:  public
see:  ResultSet::getString()


Overridden in child classes as:

MySQLResultSet::getString()
Get string version of column.

[ Top ]

method getTime [line 401]

void getTime( mixed $column, [mixed $format = '%X'])



Tags:

access:  public
see:  ResultSet::getTime()


[ Top ]

method getTimestamp [line 425]

void getTimestamp( mixed $column, [mixed $format = 'Y-m-d H:i:s'])



Tags:

access:  public
see:  ResultSet::getTimestamp()


Overridden in child classes as:

MySQLResultSet::getTimestamp()
Returns a unix epoch timestamp based on either a TIMESTAMP or DATETIME field.

[ Top ]

method isAfterLast [line 254]

void isAfterLast( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


Overridden in child classes as:

ODBCCachedResultSet::isAfterLast()

[ Top ]

method isBeforeFirst [line 262]

void isBeforeFirst( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method isIgnoreAssocCase [line 135]

void isIgnoreAssocCase( )



Tags:

access:  public
see:  ResultSet::isIgnoreAssocCase()


[ Top ]

method last [line 225]

void last( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method previous [line 159]

void previous( )



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method relative [line 173]

void relative( mixed $offset)



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]

method setFetchmode [line 143]

void setFetchmode( mixed $mode)



Tags:

access:  public
see:  ResultSet::isBeforeFirst()


[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:53:07 -0400 by phpDocumentor 1.3.0RC3