diff --git a/inc/class.section.php b/inc/class.section.php --- a/inc/class.section.php +++ b/inc/class.section.php @@ -23,8 +23,10 @@ require_once dirname(__FILE__) . DIRECTO /** * \brief * Represent a Section associated with a Course. + * + * Iterating over a Section yields section_SectionMeeting objects. */ -class Section +class Section implements IteratorAggregate { private $letter; // Section letter @@ -70,6 +72,15 @@ class Section $this->credit_hours = (float)$credit_hours; } + /** + * \brief + * Implements the IteratorAggregate interface. + */ + public function getIterator() + { + return new ArrayIterator($this->meetings); + } + public function getLetter() { return $this->letter;