ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
MDB2_BufferedResult_oci8 Class Reference
+ Inheritance diagram for MDB2_BufferedResult_oci8:
+ Collaboration diagram for MDB2_BufferedResult_oci8:

Public Member Functions

 _fillBuffer ($rownum=null)
 Fill the row buffer.
fetchRow ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rownum=null)
 Fetch a row and insert the data into an existing array.
 seek ($rownum=0)
 Seek to a specific row in a result set.
 valid ()
 Check if the end of the result set has been reached.
 numRows ()
 Returns the number of rows in a result object.
 free ()
 Free the internal resources associated with $result.
- Public Member Functions inherited from MDB2_Result_oci8
 _getColumnNames ()
 Retrieve the names of columns returned by the DBMS in a query result.
 numCols ()
 Count the number of columns returned by the DBMS in a query result.
- Public Member Functions inherited from MDB2_Result_Common
 __construct (&$db, &$result, $limit=0, $offset=0)
 Constructor.
 MDB2_Result_Common (&$db, &$result, $limit=0, $offset=0)
 PHP 4 Constructor.
 setResultTypes ($types)
 Define the list of types to be associated with the columns of a given result set.
 fetchOne ($colnum=0, $rownum=null)
 fetch single column from the next row from a result set
 fetchCol ($colnum=0)
 Fetch and return a column from the current row pointer position.
 fetchAll ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false)
 Fetch and return all rows from the current row pointer position.
 rowCount ()
 Returns the actual row number that was last fetched (count from 0)
 nextResult ()
 Move the internal result pointer to the next available result.
 getColumnNames ($flip=false)
 Retrieve the names of columns returned by the DBMS in a query result or from the cache.
 getResource ()
 return the resource associated with the result object
 bindColumn ($column, &$value, $type=null)
 Set bind variable to a column.
 _assignBindColumns ($row)
 Bind a variable to a value in the result row.

Data Fields

 $buffer
 $buffer_rownum = - 1

Detailed Description

Definition at line 1134 of file oci8.php.

Member Function Documentation

MDB2_BufferedResult_oci8::_fillBuffer (   $rownum = null)

Fill the row buffer.

Parameters
int$rownumrow number upto which the buffer should be filled if the row number is null all rows are ready into the buffer
Returns
boolean true on success, false on failure protected

Definition at line 1149 of file oci8.php.

References $buffer, $buffer_rownum, $row, and MDB2_Result_Common\$rownum.

Referenced by fetchRow(), numRows(), and valid().

{
if (isset($this->buffer) && is_array($this->buffer)) {
if (is_null($rownum)) {
if (!end($this->buffer)) {
return false;
}
} elseif (isset($this->buffer[$rownum])) {
return (bool)$this->buffer[$rownum];
}
}
$row = true;
while ((is_null($rownum) || $this->buffer_rownum < $rownum)
&& ($row = @OCIFetchInto($this->result, $buffer, OCI_RETURN_NULLS))
) {
// remove additional column at the end
if ($this->offset > 0) {
array_pop($buffer);
}
if (empty($this->types)) {
foreach (array_keys($buffer) as $key) {
if (is_a($buffer[$key], 'oci-lob')) {
$buffer[$key] = $buffer[$key]->load();
}
}
}
$this->buffer[$this->buffer_rownum] = $buffer;
}
if (!$row) {
$this->buffer[$this->buffer_rownum] = false;
return false;
}
return true;
}

+ Here is the caller graph for this function:

& MDB2_BufferedResult_oci8::fetchRow (   $fetchmode = MDB2_FETCHMODE_DEFAULT,
  $rownum = null 
)

Fetch a row and insert the data into an existing array.

Parameters
int$fetchmodehow the array data should be indexed
int$rownumnumber of the row where the data can be found
Returns
int data array on success, a MDB2 error on failure public

Reimplemented from MDB2_Result_oci8.

Definition at line 1199 of file oci8.php.

References MDB2_Result_Common\$column_names, $row, MDB2_Result_Common\$rownum, MDB2_Result_Common\_assignBindColumns(), _fillBuffer(), MDB2_Result_Common\getColumnNames(), PEAR\isError(), MDB2_ERROR_NEED_MORE_DATA, MDB2_FETCHMODE_ASSOC, MDB2_FETCHMODE_DEFAULT, MDB2_FETCHMODE_OBJECT, MDB2_PORTABILITY_RTRIM, and seek().

{
if ($this->result === false) {
$err =& $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
return $err;
} elseif (is_null($this->result)) {
return null;
}
if (!is_null($rownum)) {
$seek = $this->seek($rownum);
if (PEAR::isError($seek)) {
return $seek;
}
}
$target_rownum = $this->rownum + 1;
if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
$fetchmode = $this->db->fetchmode;
}
if (!$this->_fillBuffer($target_rownum)) {
$null = null;
return $null;
}
$row = $this->buffer[$target_rownum];
if ($fetchmode & MDB2_FETCHMODE_ASSOC) {
foreach ($column_names as $name => $i) {
$column_names[$name] = $row[$i];
}
}
$mode = 0;
$rtrim = false;
if ($this->db->options['portability'] & MDB2_PORTABILITY_RTRIM) {
if (empty($this->types)) {
} else {
$rtrim = true;
}
}
if ($mode) {
$this->db->_fixResultArrayValues($row, $mode);
}
if (!empty($this->types)) {
$row = $this->db->datatype->convertResultRow($this->types, $row, $rtrim);
}
if (!empty($this->values)) {
}
if ($fetchmode === MDB2_FETCHMODE_OBJECT) {
$object_class = $this->db->options['fetch_class'];
if ($object_class == 'stdClass') {
$row = (object) $row;
} else {
$row = &new $object_class($row);
}
}
return $row;
}

+ Here is the call graph for this function:

MDB2_BufferedResult_oci8::free ( )

Free the internal resources associated with $result.

Returns
boolean true on success, false if $result is invalid public

Reimplemented from MDB2_Result_oci8.

Definition at line 1333 of file oci8.php.

{
$this->buffer = null;
$this->buffer_rownum = null;
return parent::free();
}
MDB2_BufferedResult_oci8::numRows ( )

Returns the number of rows in a result object.

Returns
mixed MDB2 Error Object or the number of rows public

Reimplemented from MDB2_Result_Common.

Definition at line 1312 of file oci8.php.

References $buffer_rownum, _fillBuffer(), and MDB2_ERROR_NEED_MORE_DATA.

{
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
} elseif (is_null($this->result)) {
return 0;
}
$this->_fillBuffer();
}

+ Here is the call graph for this function:

MDB2_BufferedResult_oci8::seek (   $rownum = 0)

Seek to a specific row in a result set.

Parameters
int$rownumnumber of the row where the data can be found
Returns
mixed MDB2_OK on success, a MDB2 error on failure public

Reimplemented from MDB2_Result_Common.

Definition at line 1270 of file oci8.php.

References MDB2_Result_Common\$rownum, MDB2_ERROR_NEED_MORE_DATA, and MDB2_OK.

Referenced by fetchRow().

{
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
}
$this->rownum = $rownum - 1;
return MDB2_OK;
}

+ Here is the caller graph for this function:

MDB2_BufferedResult_oci8::valid ( )

Check if the end of the result set has been reached.

Returns
mixed true or false on sucess, a MDB2 error on failure public

Definition at line 1289 of file oci8.php.

References _fillBuffer(), and MDB2_ERROR_NEED_MORE_DATA.

{
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
} elseif (is_null($this->result)) {
return true;
}
if ($this->_fillBuffer($this->rownum + 1)) {
return true;
}
return false;
}

+ Here is the call graph for this function:

Field Documentation

MDB2_BufferedResult_oci8::$buffer

Definition at line 1136 of file oci8.php.

Referenced by _fillBuffer().

MDB2_BufferedResult_oci8::$buffer_rownum = - 1

Definition at line 1137 of file oci8.php.

Referenced by _fillBuffer(), and numRows().


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