Source for file DataContainer.interface.php

Documentation is available at DataContainer.interface.php

  1. <?php
  2.  
  3. /**
  4. * The DataContainer Interface defines the required methods for any DataContainer class or child.
  5. *
  6. * @package harmoni.utilities
  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: DataContainer.interface.php,v 1.6 2007/09/04 20:25:54 adamfranco Exp $
  12. */
  13. class DataContainerInterface {
  14. /**
  15. * The init function -- sets up the private variables.
  16. * @access protected
  17. * @return void
  18. ***/
  19. function init() {
  20. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  21. }
  22. /**
  23. * The add method adds a new field with associated rule and optional error if validation fails.
  24. * @param string $field The key of the field to add.
  25. * @param ref object ValidatorRule $rule The validator rule to apply to the value set to this key.
  26. * @param optional object Error $error The error to throw if validation of this key fails.
  27. * @access protected
  28. * @return void
  29. ***/
  30. function add( $field, $rule, $error = null ) {
  31. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  32. }
  33. /**
  34. * The get method returns the value stored in the FieldSet for $field.
  35. * @param string $field The field to get.
  36. * @access public
  37. * @return mixed The value of $field.
  38. ***/
  39. function get( $field ) {
  40. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  41. }
  42. /**
  43. * The set method sets the value for a field while checking constrictions.
  44. * @param string $field The field to set.
  45. * @param mixed $val The value to set $field to.
  46. * @access public
  47. * @return boolean True if setting $field succeeds.
  48. ***/
  49. function set( $field, $val ) {
  50. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  51. }
  52. /**
  53. * Goes through all the keys and makes sure they comply to the rules specified for them.
  54. * @access public
  55. * @return boolean TRUE if all are OK, FALSE otherwise.
  56. ***/
  57. function checkAll() {
  58. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  59. }
  60. }
  61.  
  62. ?>

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