Source for file EnrollmentRecord.class.php

Documentation is available at EnrollmentRecord.class.php

  1. <?php
  2.  
  3. require_once(OKI2."/osid/coursemanagement/EnrollmentRecord.php");
  4.  
  5. /**
  6. * EnrollmentRecord stores a student (Agent) and an Enrollment Status Type.
  7. * The EnrollmentRecord is the result of adding or changing a student in a
  8. * CourseSection. If the student is removed from the CourseSection, there
  9. * will no longer be an EnrollmentRecord for the student. The joining of a
  10. * status type to a student allows for the characterization of the student.
  11. * For example, students might be added as regular students or auditing.
  12. * Students might be on the enrollment list, but their status might be
  13. * withdrawn passing or withdrawn failing, etc.
  14. *
  15. * <p>
  16. * OSID Version: 2.0
  17. * </p>
  18. *
  19. * @package harmoni.osid_v2.coursemanagement
  20. *
  21. * @copyright Copyright &copy; 2005, Middlebury College
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  23. *
  24. * @version $Id: EnrollmentRecord.class.php,v 1.11 2007/09/04 20:25:39 adamfranco Exp $
  25. */
  26. class HarmoniEnrollmentRecord
  27. extends EnrollmentRecord
  28. {
  29. /**
  30. * @variable object $_id the unique id for this EnrollmentRecord.
  31. * @access private
  32. * @variable object $_table the term table.
  33. * @access private
  34. ***/
  35. var $_id;
  36. var $_table;
  37. /**
  38. * The constructor.
  39. *
  40. * @param object Id $id
  41. *
  42. * @access public
  43. * @return void
  44. */
  45. function HarmoniEnrollmentRecord($id)
  46. {
  47. $this->_id =$id;
  48. $this->_table = 'cm_enroll';
  49. }
  50. /**
  51. * Get the Id of the Agent representing a student enrolled in the
  52. * CourseSection.
  53. *
  54. * @return object Id
  55. *
  56. * @throws object CourseManagementException An exception
  57. * with one of the following messages defined in
  58. * org.osid.coursemanagement.CourseManagementException may be
  59. * thrown: {@link }
  60. * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
  61. * OPERATION_FAILED}, {@link }
  62. * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
  63. * PERMISSION_DENIED}, {@link }
  64. * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
  65. * CONFIGURATION_ERROR}, {@link }
  66. * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
  67. * UNIMPLEMENTED}
  68. *
  69. * @access public
  70. */
  71. function getStudent () {
  72. $idManager = Services::getService("IdManager");
  73. $idString = $this->_getField('fk_student_id');
  74. $ret =$idManager->getId($idString);
  75. return $ret;
  76. }
  77. /**
  78. * Get the CourseSection that this EnrollmentRecord
  79. * enrolls the student in.
  80. *
  81. * WARNING: NOT IN OSID -- USE AT YOUR OWN RISK
  82. *
  83. * @return object CourseSection
  84. *
  85. * @throws object CourseManagementException An exception
  86. * with one of the following messages defined in
  87. * org.osid.coursemanagement.CourseManagementException may be
  88. * thrown: {@link }
  89. * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
  90. * OPERATION_FAILED}, {@link }
  91. * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
  92. * PERMISSION_DENIED}, {@link }
  93. * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
  94. * CONFIGURATION_ERROR}, {@link }
  95. * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
  96. * UNIMPLEMENTED}
  97. *
  98. * @access public
  99. */
  100. function getCourseSection () {
  101. $cm = Services::getService("CourseManagement");
  102. $idManager = Services::getService("IdManager");
  103. $idString = $this->_getField('fk_cm_section');
  104. $id =$idManager->getId($idString);
  105. return $cm->getCourseSection($id);
  106. }
  107.  
  108. /**
  109. * Get the Status Type for a student. Students Status Type is supplied
  110. * when the student is added or changed in the CourseSection. The
  111. * CourseManagementManager returns the Status Types supported by this
  112. * implementation.
  113. *
  114. * @return object Type
  115. *
  116. * @throws object CourseManagementException An exception
  117. * with one of the following messages defined in
  118. * org.osid.coursemanagement.CourseManagementException may be
  119. * thrown: {@link }
  120. * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
  121. * OPERATION_FAILED}, {@link }
  122. * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
  123. * PERMISSION_DENIED}, {@link }
  124. * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
  125. * CONFIGURATION_ERROR}, {@link }
  126. * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
  127. * UNIMPLEMENTED}
  128. *
  129. * @access public
  130. */
  131. function getStatus () {
  132. return $this->_getType('enroll_stat');
  133. }
  134. function _typeToIndex($typename, $type)
  135. {
  136. $cm=Services::getService("CourseManagement");
  137. return $cm->_typeToIndex($typename, $type);
  138. }
  139. function _getTypes($typename)
  140. {
  141. $cm=Services::getService("CourseManagement");
  142. return $cm->_getTypes($typename);
  143. }
  144. function _getField($key)
  145. {
  146. $cm=Services::getService("CourseManagement");
  147. return $cm->_getField($this->_id,$this->_table,$key);
  148. }
  149. function _getType($typename){
  150. $cm=Services::getService("CourseManagement");
  151. return $cm->_getType($this->_id,$this->_table,$typename);
  152. }
  153. function _setField($key, $value)
  154. {
  155. $cm=Services::getService("CourseManagement");
  156. return $cm->_setField($this->_id,$this->_table,$key, $value);
  157. }
  158. }
  159.  
  160. ?>

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