Database_ResultSet Interface Reference

Inheritance diagram for Database_ResultSet:
Mysql_ResultSet

Public Member Functions

 setFetchMode ($mode, $className=null)
 fetch ($mode=null, $className=null)
 numRows ()
 isEmpty ()

Data Fields

const FETCH_ASSOC = MYSQL_ASSOC
const FETCH_NUM = MYSQL_NUM
const FETCH_BOTH = MYSQL_BOTH
const FETCH_OBJECT = 'FETCH_OBJECT'
const FETCH_VALUE = 'FETCH_VALUE'
const FETCH_COLUMN = 'FETCH_COLUMN'
const FETCH_CLASS = 'FETCH_CLASS'

Detailed Description

Database_ResultSet generic interface

Definition at line 407 of file database.lib.php.


Member Function Documentation

fetch ( mode = null,
className = null 
)

Get the next row in the Result Set

Parameters:
string $mode fetch mode (optional, use internal fetch mode : FETCH_ASSOC by default or set by setFetchMode())
string class name used for the FETCH_CLASS mode, this class need to implement all the method in the Database_Object interface
Returns:
mixed result row, returned data type depends on fetch mode : FETCH_ASSOC, FETCH_NUM or FETCH_BOTH : array FETCH_OBJECT : object representation of the current row FETCH_CLASS : instance of the class name given FETCH_VALUE : value of the first field in the current row

Implemented in Mysql_ResultSet.

isEmpty (  ) 

Check if the result set is empty

Returns:
boolean

Implemented in Mysql_ResultSet.

numRows (  ) 

Get the number of rows in the result set

Returns:
int

Implemented in Mysql_ResultSet.

setFetchMode ( mode,
className = null 
)

Set fetch mode. If not set, the default mode is FETCH_ASSOC

Parameters:
string $mode fetch mode
string class name used for the FETCH_CLASS mode, this class need to implement all the method in the Database_Object interface
Returns:
$this for chaining

Implemented in Mysql_ResultSet.


Field Documentation

const FETCH_ASSOC = MYSQL_ASSOC

Associative array fetch mode constant, default mode if no one specified

Definition at line 412 of file database.lib.php.

const FETCH_BOTH = MYSQL_BOTH

Associative and numeric array fetch mode constant

Definition at line 422 of file database.lib.php.

Fetch the next rows as a new instance of the class name specified as the second argument of Database_ResultSet::setFetchMode

This class must implement the magic static __set_state method

Since:
Claroline 1.9.5

Definition at line 446 of file database.lib.php.

Fetch the value of the first column of each row of the result set

Definition at line 437 of file database.lib.php.

const FETCH_NUM = MYSQL_NUM

Numeric index array fetch mode constant

Definition at line 417 of file database.lib.php.

Object fetch mode constant

Definition at line 427 of file database.lib.php.

Fetch the value of the first column of the first row of the result set

Definition at line 432 of file database.lib.php.


The documentation for this interface was generated from the following file:
Generated on Tue Jun 8 12:28:38 2010 for Claroline API by  doxygen 1.6.3