Mysql_ResultSet Class Reference

Inheritance diagram for Mysql_ResultSet:
Database_ResultSet

Public Member Functions

 __construct ($result)
 __destruct ()
 setFetchMode ($mode, $className=null)
 numRows ()
 isEmpty ()
 fetch ($mode=null, $className=null)
 count ()
 valid ()
 current ()
 next ()
 rewind ()
 key ()
 seek ($idx)

Protected Attributes

 $mode
 $className
 $idx
 $valid
 $numrows
 $resultSet

Detailed Description

Mysql _Database_Connection Result Set class implements iterator and countable interfaces for array-like behaviour.

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


Constructor & Destructor Documentation

__construct ( result  ) 
Parameters:
resource $result Mysql native resultset

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

__destruct (  ) 

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


Member Function Documentation

count (  ) 

Count the number of rows in the result set Usage : $size = count( $resultSet );

See also:
Countable
Returns:
int size of the result set (ie number of rows)

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

current (  ) 

Return the current row

See also:
Iterator
Database_ResultSet::fetch() for return value data type
Returns:
mixed, current row

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

fetch ( mode = null,
className = null 
)

Get the next row in the Result Set

See also:
Database_ResultSet
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

Implements Database_ResultSet.

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

isEmpty (  ) 

Check if the result set is empty

See also:
Database_ResultSet
Returns:
boolean

Implements Database_ResultSet.

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

key (  ) 

Return the index of the current row

See also:
Iterator
Returns:
int

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

next (  ) 

Advance to the next row in the result set

See also:
Iterator

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

numRows (  ) 

Get the number of rows in the result set

See also:
Database_ResultSet
Returns:
int

Implements Database_ResultSet.

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

rewind (  ) 

Rewind to the first row

See also:
Iterator

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

seek ( idx  ) 

Usage : $resultSet->seek( 5 ); $r = $resultSet->fetch();

See also:
SeekableIterator
Parameters:
int $idx
Returns:
void
Exceptions:
OutOfBoundsException if invalid index

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

setFetchMode ( mode,
className = null 
)

Set fetch mode

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
See also:
Database_ResultSet
Returns:
$this

Implements Database_ResultSet.

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

valid (  ) 

Check if the current position in the result set is valid

See also:
Iterator
Returns:
boolean

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


Field Documentation

$className [protected]

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

$idx [protected]

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

$mode [protected]

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

$numrows [protected]

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

$resultSet [protected]

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

$valid [protected]

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


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