Source for file HarmoniTimespan.class.php

Documentation is available at HarmoniTimespan.class.php

  1. <?php
  2.  
  3. //require_once(OKI2."/osid/scheduling/Timespan.php");
  4. //require_once(HARMONI."Primitives/Chronology/Timespan.class.php");
  5.  
  6.  
  7.  
  8.  
  9.  
  10. /**
  11. * Timespan defines a time span in terms of a start and end date and time.
  12. * Warning! This extends a completely differnt Timespan, so thing may
  13. * get messy.
  14. *
  15. * <p>
  16. * OSID Version: 2.0
  17. * </p>
  18. *
  19. * <p>
  20. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  21. * O.K.I&#46; OSID Definition License}.
  22. * </p>
  23. *
  24. * @package org.osid.scheduling
  25. */
  26. class HarmoniTimespan
  27. {
  28. /**
  29. * @variable long $_start the start of the time span
  30. * @access private
  31. * @variable long $_end the end of the time span
  32. * @access private
  33. ***/
  34. var $_start;
  35. var $_end;
  36. /**
  37. * The constructor.
  38. *
  39. * @param long $_start the start of the time span
  40. * @param long $_end the end of the time span
  41. *
  42. * @access public
  43. * @return void
  44. */
  45. function HarmoniTimespan($start, $end)
  46. {
  47. if($start>$end){
  48. throwError(new Error("The end of a Timespan cannot come before the end", "HarmoniTimespan", true));
  49. }
  50. $this->_start = $start;
  51. $this->_end = $end;
  52. }
  53. /**
  54. * Get the Start date and time of this Timespan.
  55. *
  56. * @return int
  57. *
  58. * @throws object SchedulingException An exception with one of
  59. * the following messages defined in
  60. * org.osid.scheduling.SchedulingException may be thrown: {@link }
  61. * org.osid.scheduling.SchedulingException#OPERATION_FAILED
  62. * OPERATION_FAILED}, {@link }
  63. * org.osid.scheduling.SchedulingException#PERMISSION_DENIED
  64. * PERMISSION_DENIED}, {@link }
  65. * org.osid.scheduling.SchedulingException#CONFIGURATION_ERROR
  66. * CONFIGURATION_ERROR}, {@link }
  67. * org.osid.scheduling.SchedulingException#UNIMPLEMENTED
  68. * UNIMPLEMENTED}
  69. *
  70. * @access public
  71. */
  72. function getStart () {
  73. return $this->_start;
  74. }
  75.  
  76. /**
  77. * Get the End date and time of this Timespan.
  78. *
  79. * @return int
  80. *
  81. * @throws object SchedulingException An exception with one of
  82. * the following messages defined in
  83. * org.osid.scheduling.SchedulingException may be thrown: {@link }
  84. * org.osid.scheduling.SchedulingException#OPERATION_FAILED
  85. * OPERATION_FAILED}, {@link }
  86. * org.osid.scheduling.SchedulingException#PERMISSION_DENIED
  87. * PERMISSION_DENIED}, {@link }
  88. * org.osid.scheduling.SchedulingException#CONFIGURATION_ERROR
  89. * CONFIGURATION_ERROR}, {@link }
  90. * org.osid.scheduling.SchedulingException#UNIMPLEMENTED
  91. * UNIMPLEMENTED}
  92. *
  93. * @access public
  94. */
  95. function getEnd () {
  96. return $this->_end;
  97. }
  98. }
  99.  
  100. ?>

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