Source for file SelectQueryResult.interface.php

Documentation is available at SelectQueryResult.interface.php

  1. <?php
  2.  
  3. require_once("QueryResult.interface.php");
  4.  
  5.  
  6. /**
  7. * A constant indicating an associative array.
  8. * @const integer ASSOC
  9. * @package harmoni.dbc
  10. */
  11. define("ASSOC", 1);
  12.  
  13.  
  14. /**
  15. * A constant indicating a numeric array.
  16. * @const integer NUMERIC
  17. * @package harmoni.dbc
  18. */
  19. define("NUMERIC", 2);
  20.  
  21.  
  22. /**
  23. * A constant indicating an array that has both numeric and associative (string)
  24. * indices.
  25. * @const integer BOTH
  26. * @package harmoni.dbc
  27. */
  28. define("BOTH", 3);
  29.  
  30.  
  31.  
  32.  
  33. /**
  34. * The SelectQueryResult interface provides the functionality common to a SELECT query result.
  35. *
  36. * The SelectQueryResult interface provides the functionality common to a SELECT query result.
  37. * For example, you can fetch associative arrays, advance the current row position, etc.
  38. * @version $Id: SelectQueryResult.interface.php,v 1.8 2007/09/05 21:38:59 adamfranco Exp $
  39. * @package harmoni.dbc
  40. * @access public
  41. * @copyright 2003
  42. */
  43.  
  44. interface SelectQueryResultInterface
  45. extends QueryResultInterface
  46. {
  47.  
  48. /**
  49. * Returns the resource id for this SELECT query.
  50. * Returns the resource id for this SELECT query. The resource id is returned
  51. * by the mysql_query() function.
  52. * @access public
  53. * @return integer The resource id for this SELECT query.
  54. ***/
  55. function getResourceId() ;
  56. /**
  57. /**
  58. * Indicates if there are any remaining rows returned by the SELECT query.
  59. * Indicates if there are any remaining rows returned by the SELECT query including
  60. * the current row.
  61. * @access public
  62. * @return boolean True, if there are some rows left; False, otherwise.
  63. ***/
  64. function hasNext() ;
  65.  
  66. /**
  67. /**
  68. * Returns an array that stores the current row in the result and advances
  69. * to the next row. The data
  70. * can be accessed through associative indices <b>as well as</b> numeric indices.
  71. * @access public
  72. * @param optional integer arrayType Specifies what type of an array to return.
  73. * Allowed values are: ASSOC, NUMERIC, and BOTH.
  74. * @return array An associative array of the current row.
  75. ***/
  76. function next();
  77. /**
  78. /**
  79. * Advances the current row position.
  80. * Advances the current row position. If there are no more rows left, then
  81. * it returns <code>false</code>.
  82. * @access public
  83. * @return boolean True, if successful; False, otherwise.
  84. */
  85. function advanceRow();
  86.  
  87. /**
  88. /**
  89. * Indicates if there are any remaining rows returned by the SELECT query.
  90. * Indicates if there are any remaining rows returned by the SELECT query including
  91. * the current row.
  92. * @access public
  93. * @return boolean True, if there are some rows left; False, otherwise.
  94. ***/
  95. function hasMoreRows();
  96.  
  97. /**
  98. /**
  99. * Returns the specified field value in the current row.
  100. * Returns the specified field value in the current row.
  101. * @param mixed $field The name or index of the field, whose value will be returned.
  102. * @access public
  103. * @return mixed The value that was requested.
  104. ***/
  105. function field($field);
  106. /**
  107. /**
  108. * Get the number of fields that were selected by the SELECT query.
  109. * Get the number of fields that were selected by the SELECT query.
  110. * @access public
  111. * @return integer The number of fields.
  112. ***/
  113. function getNumberOfFields();
  114.  
  115. /**
  116. /**
  117. * Returns an indexed array of all field names that were selected.
  118. * Returns an indexed array of all field names that were selected.
  119. * @access public
  120. * @return array An array of all field names that were selected.
  121. ***/
  122. function getFieldNames();
  123. /**
  124. /**
  125. * Returns an array that stores the current row in the result. The data
  126. * can be accessed through associative indices <b>as well as</b> numeric indices.
  127. * @access public
  128. * @param optional integer arrayType Specifies what type of an array to return.
  129. * Allowed values are: ASSOC, NUMERIC, and BOTH.
  130. * @return array An associative array of the current row.
  131. ***/
  132. function getCurrentRow($arrayType = BOTH);
  133. /**
  134. /**
  135. * Moves the internal row pointer to the specified position. The range of
  136. * possible values is <code>0 - (getNumberOfRows()-1)</code>.
  137. * @param integer rowNumber The number of the row to move to.
  138. * @access public
  139. * @return boolean <code>true</code>, if operation was successful; <code>false</code>, otherwise.
  140. */
  141. function moveToRow($rowNumber);
  142. /**
  143. /**
  144. * Binds the field specified by the first argument to the variable given as
  145. * the second argument. The method stores a reference to the variable represented
  146. * by the second argument; whenever a new row is fetched, the value of the field
  147. * in the new row will be updated in the referenced variable. This enables the
  148. * user to avoid unnecessary calls to <code>getCurrentRow()</code> or
  149. * <code>field()</code>.
  150. * @access public
  151. * @param string field The field to bind. This could be either
  152. * a string value that would correspond to the field as returned by
  153. * <code>getFieldNames()</code>, or an integer (less than <code>getNumberOfFields()</code>)
  154. * corresponding to the index of the field.
  155. * @param ref mixed var The variable to be bound to the value of the field in
  156. * the current row.
  157. ***/
  158. function bindField($field, $var);
  159. /**
  160. /**
  161. * Unbinds the field that has been bound by <code>bindField()</code>.
  162. * @access public
  163. * @param string field The field to unbind. This could be either
  164. * a string value that would correspond to the field as returned by
  165. * <code>getFieldNames()</code>, or an integer (less than <code>getNumberOfFields()</code>)
  166. * corresponding to the index of the field.
  167. ***/
  168. function unbindField($field);
  169. /**
  170. /**
  171. * Frees the memory for this result.
  172. * @access public
  173. * @return void
  174. */
  175. function free();
  176.  
  177.  
  178.  
  179. ?>

Documentation generated on Wed, 19 Sep 2007 10:26:23 -0400 by phpDocumentor 1.3.0RC3