topical media & game development

talk show tell print

professional-php-05-class.student.php / php



  <?php
  class Student {
    private _id;
    private _name;
  
    public courses;
    
    public function __construct(id, name) {
      this->_id = id;
      this->_name = name;
      
      this->courses = new CourseCollection();
      this->courses->setLoadCallback('_loadCourses', this);
    }
    
    public function getName() {
      return this->_name;
    }
    
    public function getID() {
      return this->_id;
    }
    
    private function _loadCourses(Collection col) {
      arCourses = StudentFactory::getCoursesForStudent(this->_id, col);
    }
  
    public function __toString() {
      return this->_name;
    }
  }
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.