Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pgsql_native_moodle_recordset Class Reference

pgsql specific moodle recordset class More...

Inheritance diagram for pgsql_native_moodle_recordset:
moodle_recordset

Public Member Functions

 __construct ($result, pgsql_native_moodle_database $db=null, $cursorname='')
 Build a new recordset to iterate over. More...
 
 close ()
 Did we reach the end? More...
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 Returns current record - fields as object properties, lowercase. More...
 
 valid ()
 

Protected Member Functions

 fetch_cursor_block ()
 Fetches the next block of data when using cursors. More...
 

Protected Attributes

 $blobs = array()
 
current $current
 row as array.
 
string $cursorname
 Name of cursor or '' if none.
 
pgsql_native_moodle_database $db
 Postgres database resource.
 
bool $lastbatch
 True if there are no more rows to fetch from the cursor.
 
 $result
 

Detailed Description

pgsql specific moodle recordset class

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

pgsql_native_moodle_recordset::__construct (   $result,
pgsql_native_moodle_database  $db = null,
  $cursorname = '' 
)

Build a new recordset to iterate over.

When using cursors, $result will be null initially.

Parameters
resource | null$resultA pg_query() result object to create a recordset from.
pgsql_native_moodle_database$dbDatabase object (only required when using cursors)
string$cursornameName of cursor or '' if none

Member Function Documentation

◆ close()

pgsql_native_moodle_recordset::close ( )

Did we reach the end?

Return values
booleanFree resources and connections, recordset can not be used anymore.
void

Reimplemented from moodle_recordset.

◆ fetch_cursor_block()

pgsql_native_moodle_recordset::fetch_cursor_block ( )
protected

Fetches the next block of data when using cursors.

Exceptions
coding_exceptionIf you call this when the fetch buffer wasn't freed yet

◆ rewind()

moodle_recordset::rewind ( )
inherited

Returns current record - fields as object properties, lowercase.

Return values
objectReturns the key of current row
intcurrent row Moves forward to next row
voidRewinds are not supported!
void

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