.

DBResultSetSphinx Class Reference
[Sphinx]

Result set for Sphinx. More...

Inheritance diagram for DBResultSetSphinx:
IDBResultSet DBResultSetCountSphinx

List of all members.

Public Member Functions

  __construct ($result, $status)
  close ()
  Closes internal cursor.
  fetch ()
  Returns row as associative array.
  get_column_count ()
  Returns number of columns in result set.
  get_row_count ()
  Returns number of rows in result set.
  get_status ()
  Returns status.

Protected Member Functions

  read_record ($arr_record)

Protected Attributes

  $result = null
  $status

Detailed Description

Result set for Sphinx.

Author:
Gerd Riesselmann

Definition at line 8 of file dbresultset.sphinx.php.


Constructor & Destructor Documentation

DBResultSetSphinx::__construct ( result,
status  
)

Definition at line 17 of file dbresultset.sphinx.php.

00017                                                       {
00018                 $this->result = $result;
00019                 $this->status = $status;
00020         }

Member Function Documentation

DBResultSetSphinx::close (  ) 

Closes internal cursor.

Returns:
void

Implements IDBResultSet.

Definition at line 27 of file dbresultset.sphinx.php.

00027                                 {
00028                 $this->result = null;
00029         }
DBResultSetSphinx::fetch (  ) 

Returns row as associative array.

Returns:
array | bool False if no more data is available

Implements IDBResultSet.

Reimplemented in DBResultSetCountSphinx.

Definition at line 58 of file dbresultset.sphinx.php.

00058                                 {
00059                 $ret = false;
00060                 if ($this->result) {
00061                         $record = each($this->result['matches']);
00062                         if ($record) {
00063                                 $ret = $this->read_record($record['value']);
00064                         }
00065                 }
00066                 return $ret;
00067         }
DBResultSetSphinx::get_column_count (  ) 

Returns number of columns in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 36 of file dbresultset.sphinx.php.

00036                                            {
00037                 return 0;
00038         }
DBResultSetSphinx::get_row_count (  ) 

Returns number of rows in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 45 of file dbresultset.sphinx.php.

00045                                         {
00046                 $ret = 0;
00047                 if ($this->result) {
00048                         $ret = $this->result['total'];
00049                 }
00050                 return $ret;
00051         }
DBResultSetSphinx::get_status (  ) 

Returns status.

Parameters:
Status 

Implements IDBResultSet.

Definition at line 87 of file dbresultset.sphinx.php.

00087                                      {
00088                 return $this->status;
00089         }
DBResultSetSphinx::read_record ( arr_record  )  [protected]

Definition at line 69 of file dbresultset.sphinx.php.

00069                                                     {
00070                 $ret = array();
00071                 foreach($arr_record as $key => $value) {
00072                         if (is_array($value)) {
00073                                 $ret = array_merge($ret, $this->read_record($value));
00074                         }
00075                         else {
00076                                 $ret[$key] = $value;
00077                         }       
00078                 }
00079                 return $ret;
00080         }

Member Data Documentation

DBResultSetSphinx::$result = null [protected]

Definition at line 14 of file dbresultset.sphinx.php.

DBResultSetSphinx::$status [protected]

Definition at line 15 of file dbresultset.sphinx.php.


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