Source for file MySQLUpdateQueryResult.class.php

Documentation is available at MySQLUpdateQueryResult.class.php

  1. <?php
  2. /**
  3. * @package harmoni.dbc.mysql
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: MySQLUpdateQueryResult.class.php,v 1.6 2007/09/05 21:39:00 adamfranco Exp $
  9. */
  10. require_once(HARMONI."DBHandler/UpdateQueryResult.interface.php");
  11.  
  12. /**
  13. * The UPDATEQueryResult interface provides the functionality common to all UPDATE query results.
  14. *
  15. * For example, you can get the primary key for the last UPDATEion, get number of UPDATEed rows, etc.
  16. *
  17. * @package harmoni.dbc.mysql
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: MySQLUpdateQueryResult.class.php,v 1.6 2007/09/05 21:39:00 adamfranco Exp $
  23. */
  24.  
  25. class MySQLUpdateQueryResult
  26. implements UpdateQueryResultInterface
  27. {
  28.  
  29.  
  30. /**
  31. * The link identifier for the database connection.
  32. * The link identifier for the database connection.
  33. * @param integer $_linkId The link identifier for the database connection.
  34. * @access private
  35. */
  36. var $_linkId;
  37.  
  38.  
  39. /**
  40. * Stores the number of rows processed by the query.
  41. * Stores the number of rows processed by the query.
  42. * @var integer $_numberOfRows The number of rows processed by the query.
  43. * @access private
  44. */
  45. var $_numberOfRows;
  46.  
  47.  
  48.  
  49. /**
  50. * Creates a new MySQLINSERTQueryResult object.
  51. * Creates a new MySQLINSERTQueryResult object.
  52. * @access public
  53. * @param integer $linkId The link identifier for the database connection.
  54. * @return object MySQLINSERTQueryResult A new MySQLINSERTQueryResult object.
  55. */
  56. function MySQLUpdateQueryResult($linkId) {
  57. // ** parameter validation
  58. $resourceRule = ResourceValidatorRule::getRule();
  59. ArgumentValidator::validate($linkId, $resourceRule, true);
  60. // ** end of parameter validation
  61.  
  62. $this->_linkId = $linkId;
  63.  
  64. $this->_numberOfRows = mysql_affected_rows($this->_linkId);
  65. }
  66.  
  67.  
  68. /**
  69. * Returns the number of rows that the query processed.
  70. * Returns the number of rows that the query processed. For a SELECT query,
  71. * this would be the total number of rows selected. For a DELETE, INSERT, or
  72. * UPDATE query, this would be the number of rows that were affected.
  73. * @return integer Number of rows that were processed by the query.
  74. * @access public
  75. */
  76. function getNumberOfRows() {
  77. return $this->_numberOfRows;
  78. }
  79.  
  80. }
  81.  
  82. ?>

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