<?php
$objStudent = StudentFactory::getStudent(12345); // pobiera studenta #12345
foreach($objStudent->courses as $key => $objCourse){
   print $objStudent . ' jest zapisany na kurs ' . $objCourse . "<br>\ n";
}
?>