function Student::__construct

7.x Student.php Student::__construct($student_id = "", DatabaseHandler $db = NULL, $school_id = NULL)
6.x Student.php Student::__construct($student_id = "", DatabaseHandler $db = NULL, $school_id = NULL)

File

classes/Student.php, line 12

Class

Student

Code

function __construct($student_id = "", DatabaseHandler $db = NULL, $school_id = NULL) 
 {

  $this->student_id = $student_id;

  if ($school_id === NULL) {
    // Lookup this student's school_id if it was not supplied.
    $school_id = intval(db_result(db_query("SELECT school_id FROM users WHERE cwid = ? AND is_student = 1", array($student_id))));
  }


  $this->school_id = $school_id;
  $this->array_hide_grades_terms = array();
  $this->array_significant_courses = array(); // array of course_ids
  // the student has taken, or has subs for (or transfer eqv's).
  // used later to help speed up assignCoursesToList in FlightPath.

  $this->db = $db;
  if ($db == NULL) 
   {
    $this->db = get_global_database_handler();
  }

  // Go ahead and load and assemble
  // all information in the database on this student.
  $this->load_student();

}