Source for file HarmoniAgentCommitment.class.php

Documentation is available at HarmoniAgentCommitment.class.php

  1. <?php
  2. require_once(OKI2."/osid/scheduling/AgentCommitment.php");
  3.  
  4. /**
  5. * AgentCommitment joins an Agent to a Status Type. This is the Status of the
  6. * Commitment and not the Status of the Agent.
  7. *
  8. * <p>
  9. * OSID Version: 2.0
  10. * </p>
  11. *
  12. * <p>
  13. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  14. * O.K.I&#46; OSID Definition License}.
  15. * </p>
  16. *
  17. * @package org.osid.scheduling
  18. */
  19. class HarmoniAgentCommitment
  20. extends AgentCommitment
  21. {
  22. /**
  23. * @variable object $_id the unique id for this AgentCommitment.
  24. * @access private
  25. * @variable object $_table the AgentCommitment table.
  26. * @access private
  27. ***/
  28. var $_id;
  29. var $_table;
  30. /**
  31. * The constructor.
  32. *
  33. * @param object Id $id
  34. *
  35. * @access public
  36. * @return void
  37. */
  38. function HarmoniAgentCommitment($id)
  39. {
  40. $this->_id =$id;
  41. $this->_table = 'sc_commit';
  42. }
  43. /**
  44. * Get the agentId of the individual associated with this Commitment.
  45. *
  46. * @return object Id
  47. *
  48. * @throws object SchedulingException An exception with one of
  49. * the following messages defined in
  50. * org.osid.scheduling.SchedulingException may be thrown: {@link }
  51. * org.osid.scheduling.SchedulingException#OPERATION_FAILED
  52. * OPERATION_FAILED}, {@link }
  53. * org.osid.scheduling.SchedulingException#PERMISSION_DENIED
  54. * PERMISSION_DENIED}, {@link }
  55. * org.osid.scheduling.SchedulingException#CONFIGURATION_ERROR
  56. * CONFIGURATION_ERROR}, {@link }
  57. * org.osid.scheduling.SchedulingException#UNIMPLEMENTED
  58. * UNIMPLEMENTED}
  59. *
  60. * @access public
  61. */
  62. function getAgentId () {
  63. $idManager = Services::getService("Id");
  64. $id = $this->_getField('fk_agent_id');
  65. return $idManager->getId($id);
  66. }
  67.  
  68. /**
  69. * Get the Status associated with this Commitment. For example, if the
  70. * commitment is a meeting, each particpant might have one of the Status
  71. * Type values "invited", "confirmed", "declined".
  72. *
  73. * @return object Type
  74. *
  75. * @throws object SchedulingException An exception with one of
  76. * the following messages defined in
  77. * org.osid.scheduling.SchedulingException may be thrown: {@link }
  78. * org.osid.scheduling.SchedulingException#OPERATION_FAILED
  79. * OPERATION_FAILED}, {@link }
  80. * org.osid.scheduling.SchedulingException#PERMISSION_DENIED
  81. * PERMISSION_DENIED}, {@link }
  82. * org.osid.scheduling.SchedulingException#CONFIGURATION_ERROR
  83. * CONFIGURATION_ERROR}, {@link }
  84. * org.osid.scheduling.SchedulingException#UNIMPLEMENTED
  85. * UNIMPLEMENTED}
  86. *
  87. * @access public
  88. */
  89. function getStatus () {
  90. return $this->_getType('commit_stat');
  91. }
  92. /**
  93. * Get the Schedule Item this AgentCommitment is associated with.
  94. *
  95. * Warning: NOT IN OSID -- Will probably be added to the OSID, but may be
  96. * a little iffy.
  97. *
  98. * @return object ScheduleItem
  99. *
  100. * @throws object SchedulingException An exception with one of
  101. * the following messages defined in
  102. * org.osid.scheduling.SchedulingException may be thrown: {@link }
  103. * org.osid.scheduling.SchedulingException#OPERATION_FAILED
  104. * OPERATION_FAILED}, {@link }
  105. * org.osid.scheduling.SchedulingException#PERMISSION_DENIED
  106. * PERMISSION_DENIED}, {@link }
  107. * org.osid.scheduling.SchedulingException#CONFIGURATION_ERROR
  108. * CONFIGURATION_ERROR}, {@link }
  109. * org.osid.scheduling.SchedulingException#UNIMPLEMENTED
  110. * UNIMPLEMENTED}
  111. *
  112. * @access public
  113. */
  114. function getScheduleItem () {
  115. $ret = new ScheduleItem($this->_id);
  116. return $ret;
  117. }
  118. function _typeToIndex($typename, $type)
  119. {
  120. $sc=Services::getService("Scheduling");
  121. return $sc->_typeToIndex($typename, $type);
  122. }
  123. function _getTypes($typename)
  124. {
  125. $sc=Services::getService("Scheduling");
  126. return $sc->_getTypes($typename);
  127. }
  128. function _getField($key)
  129. {
  130. $sc=Services::getService("Scheduling");
  131. return $sc->_getField($this->_id,$this->_table,$key);
  132. }
  133. function _getType($typename){
  134. $sc=Services::getService("Scheduling");
  135. return $sc->_getType($this->_id,$this->_table,$typename);
  136. }
  137. function _setField($key, $value)
  138. {
  139. $sc=Services::getService("Scheduling");
  140. return $sc->_setField($this->_id,$this->_table,$key, $value);
  141. }
  142. }
  143.  
  144. ?>

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