Source for file HarmoniStringId.class.php

Documentation is available at HarmoniStringId.class.php

  1. <?php
  2.  
  3. /**
  4. * An Id class that allows for the passing of an arbitrary string as an Id object.
  5. *
  6. * @package harmoni.osid_v2.shared
  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: HarmoniStringId.class.php,v 1.6 2007/09/04 20:25:48 adamfranco Exp $
  12. */
  13.  
  14. class HarmoniStringId
  15. extends Id
  16.  
  17. // extends java.io.Serializable
  18.  
  19.  
  20.  
  21. { // begin Id
  22.  
  23.  
  24. /**
  25. * @var string $_id The id of this id.
  26. */
  27. var $_id;
  28. /**
  29. * Constructor. Creates a HarmoniId with id = $id or a new unique id if $id is NULL.
  30. * @param string $id The desired id. If NULL, a new unique id is used.
  31. *
  32. */
  33. function HarmoniStringId ( $id = NULL ) {
  34. if ($id !== NULL) {
  35. // use this id
  36. // SLOW-VALIDATE -- comment validation out to increase program speed.
  37. ArgumentValidator::validate($id, NonzeroLengthStringValidatorRule::getRule());
  38. $this->_id = $id;
  39. } else {
  40. // get a new unique id
  41. }
  42. }
  43.  
  44. // public String getIdString();
  45. function getIdString() {
  46. return $this->_id;
  47. }
  48.  
  49. // public boolean isEqual(osid.shared.Id $id);
  50. function isEqual($id) {
  51. return ($id->getIdString() == $this->_id)?true:false;
  52. }
  53.  
  54. } // end Id
  55.  
  56. ?>

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