Source for file MySQLDeleteQueryResult.class.php

Documentation is available at MySQLDeleteQueryResult.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: MySQLDeleteQueryResult.class.php,v 1.6 2007/09/05 21:39:00 adamfranco Exp $
  9. */
  10. require_once(HARMONI."DBHandler/DeleteQueryResult.interface.php");
  11.  
  12. /**
  13. * The DeleteQueryResult interface provides the functionality common to all Delete query results.
  14. *
  15. * For example, you can get the primary key for the last Deleteion, get number of Deleteed 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: MySQLDeleteQueryResult.class.php,v 1.6 2007/09/05 21:39:00 adamfranco Exp $
  23. */
  24.  
  25. class MySQLDeleteQueryResult
  26. implements DeleteQueryResultInterface
  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. /**
  41. * Stores the number of rows processed by the query.
  42. * Stores the number of rows processed by the query.
  43. * @var integer $_numberOfRows The number of rows processed by the query.
  44. * @access private
  45. */
  46. var $_numberOfRows;
  47.  
  48.  
  49. /**
  50. * Creates a new MySQLDeleteQueryResult object.
  51. * Creates a new MySQLDeleteQueryResult object.
  52. * @access public
  53. * @param integer $linkId The link identifier for the database connection.
  54. * @return object MySQLDeleteQueryResult A new MySQLDeleteQueryResult object.
  55. */
  56. function MySQLDeleteQueryResult($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. $this->_numberOfRows = mysql_affected_rows($this->_linkId);
  64. }
  65.  
  66.  
  67. /**
  68. * Returns the number of rows that the query processed.
  69. * Returns the number of rows that the query processed. For a SELECT query,
  70. * this would be the total number of rows selected. For a UPDATE, INSERT, or
  71. * Delete query, this would be the number of rows that were affected.
  72. * @return integer Number of rows that were processed by the query.
  73. * @access public
  74. */
  75. function getNumberOfRows() {
  76. return $this->_numberOfRows;
  77. }
  78.  
  79. }
  80.  
  81. ?>

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