Source for file StorablePrimitive.interface.php

Documentation is available at StorablePrimitive.interface.php

  1. <?php
  2.  
  3. /**
  4. * This interface allows for the storage into a database (or other medium) the data contained in a {@link Primitive} data type.
  5. *
  6. * @package harmoni.datamanager
  7. *
  8. * @copyright Copyright &copy; 2005, Middlebury College
  9. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  10. *
  11. * @version $Id: StorablePrimitive.interface.php,v 1.7 2007/09/04 20:25:31 adamfranco Exp $
  12. */
  13. class StorablePrimitive {
  14. /*******************************************************
  15. * Class Methods
  16. *********************************************************/
  17.  
  18. /**
  19. * Takes a single database row, which would contain the columns added by alterQuery()
  20. * and extracts the values to setup the object with the appropriate data.
  21. * @param array $dbRow
  22. * @access public
  23. * @return object StorablePrimitive
  24. * @static
  25. */
  26. function createAndPopulate( $dbRow ) { }
  27. /**
  28. * Returns a string that could be inserted into an SQL query's WHERE clause, based on the
  29. * {@link Primitive} value that is passed. It is used when searching for datasets that contain a certain
  30. * field=value pair.
  31. * @param ref object $value The {@link Primitive} object to search for.
  32. * @param int $searchType One of the SEARCH_TYPE_* constants, defining what type of search this should be (ie, equals,
  33. * contains, greater than, less than, etc)
  34. * @return string or NULL if no searching is allowed.
  35. * @static
  36. */
  37. function makeSearchString($value, $searchType = SEARCH_TYPE_EQUALS) { }
  38. /*******************************************************
  39. * Instance Methods
  40. *********************************************************/
  41.  
  42.  
  43. /**
  44. * Inserts a new row into the Database with the data contained in the object.
  45. * @param integer $dbID The {@link DBHandler} database ID to query.
  46. * @access public
  47. * @return integer Returns the new ID of the data stored.
  48. */
  49. function insert($dbID) { }
  50. /**
  51. * Uses the ID passed and updates the database row with
  52. * new data.
  53. * @param integer $dbID The {@link DBHandler} database ID to query.
  54. * @param integer $dataID The ID in the database of the data to be updated.
  55. * @access public
  56. * @return void
  57. */
  58. function update($dbID, $dataID) { }
  59. /**
  60. * Takes an existing {@link SelectQuery} and adds a table join and some columns so that
  61. * when it is executed the actual data can be retrieved from the row. The join condition must
  62. * be "fk_data = data_id_field", since the field "fk_data" is already part of the DataManager's
  63. * table structure.
  64. * @access public
  65. * @return void
  66. */
  67. function alterQuery( $query ) { }
  68. /**
  69. * Deletes the data row from the appropriate table.
  70. * @param integer $dbID The {@link DBHandler} database ID to query.
  71. * @param integer $dataID The ID in the database of the data to be deleted.
  72. * @access public
  73. * @return void
  74. */
  75. function prune($dbID, $dataID) { }
  76.  
  77. }

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