Documentation is available at CourseGroup.class.php
- <?php
- require_once(OKI2."/osid/coursemanagement/CourseGroup.php");
- /**
- * CourseGroup manages a set of CanonicalCourses. CourseGroups have a
- * CourseGroupType which characterizes the group. CourseGroups can be used to
- * model prerequisites, corequisites, majors, minors, sequences, etc.
- *
- * <p>
- * OSID Version: 2.0
- * </p>
- *
- * @package harmoni.osid_v2.coursemanagement
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: CourseGroup.class.php,v 1.9 2007/09/04 20:25:39 adamfranco Exp $
- */
- class HarmoniCourseGroup
- extends CourseGroup
- {
- /**
- * @variable object $_node the node representing this group.
- * @access private
- ***/
- var $_node;
- /**
- * The constructor.
- * @access private
- * @param object Node $id
- * @return void
- */
- function HarmoniCourseGroup($node)
- {
- $this->_node =$node;
- }
- /**
- * Update the display name for this CourseGroup.
- *
- * @param string $displayName
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#NULL_ARGUMENT
- * NULL_ARGUMENT}
- *
- * @access public
- */
- function updateDisplayName ( $displayName ) {
- $this->_node->updateDisplayName($displayName);
- }
- /**
- * Get the display name for this CourseGroup.
- *
- * @return string
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getDisplayName () {
- return $this->_node->getDisplayName();
- }
- /**
- * Get the unique Id for this CourseGroup.
- *
- * @return object Id
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getId () {
- return $this->_node->getId();
- }
- /**
- * Get the Type for this CourseGroup.
- *
- * @return object Type
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getType () {
- return $this->_node->getType();
- }
- /**
- * Add a CanonicalCourse to this CourseGroup. Order may be preserved,
- * depending on CourseGroupType.
- *
- * @param object Id $canonicalCourseId
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#NULL_ARGUMENT
- * NULL_ARGUMENT}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNKNOWN_ID
- * UNKNOWN_ID}, {@link }
- * org.osid.coursemanagement.CourseManagementException#ALREADY_ADDED
- * ALREADY_ADDED}
- *
- * @access public
- */
- function addCourse ( $canonicalCourseId ) {
- $cm=Services::getService("CourseManagement");
- $course =$cm->getCanonicalCourse($canonicalCourseId);
- $course->_node->addParent($this->_node->getId());
- }
- /**
- * Remove a CanonicalCourse from the CourseGroup.
- *
- * @param object Id $canonicalCourseId
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#NULL_ARGUMENT
- * NULL_ARGUMENT}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNKNOWN_ID
- * UNKNOWN_ID}
- *
- * @access public
- */
- function removeCourse ( $canonicalCourseId ) {
- $cm=Services::getService("CourseManagement");
- $course =$cm->getCanonicalCourse($canonicalCourseId);
- $course->_node->removeParent($this->_node->getId());
- }
- /**
- * Get all the CanonicalCourses in this CourseGroup. Note that different
- * CourseGroupType imply different ordering. For example, if the
- * CourseGroupType indicates prerequisites order would need be guaranteed;
- * if corequisites order might not need to be guaranteed.
- *
- * @return object CanonicalCourseIterator
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getCourses () {
- $cm=Services::getService("CourseManagement");
- $nodeiterator =$this->_node->getChildren();
- $arrayOfCourses = array();
- while($nodeiterator->hasNextNode()){
- $node=$nodeiterator->nextNode();
- $arrayOfCourses[] =$cm->getCanonicalCourse($node->getId());
- }
- $ret = new HarmoniCanonicalCourseIterator($arrayOfCourses);
- return $ret;
- }
- }
- ?>
Documentation generated on Wed, 19 Sep 2007 10:22:14 -0400 by phpDocumentor 1.3.0RC3