function _FlightPath::cache_course_inventory

4.x _FlightPath.php _FlightPath::cache_course_inventory($limit_start = 0, $limit_size = 4000)
5.x _FlightPath.php _FlightPath::cache_course_inventory($limit_start = 0, $limit_size = 4000)

File

classes/_FlightPath.php, line 1156

Class

_FlightPath

Code

function cache_course_inventory($limit_start = 0, $limit_size = 4000) 
 {


  // Load courses from the inventory into the inventory cache...
  // Attempt to load the course inventory cache...
  if ($course_inventory = unserialize(@$_SESSION ["fp_cache_course_inventory"])) 
   {
    $GLOBALS ["fp_course_inventory"] = $course_inventory;
  }

  $result = $this->db->db_query("SELECT DISTINCT course_id FROM courses
              WHERE 
                course_num < '{$GLOBALS ["fp_system_settings"]["graduate_level_course_num"]}'
                LIMIT $limit_start, $limit_size
              ");

  while ($cur = $this->db->db_fetch_array($result)) 
   {
    $course_id = $cur ["course_id"];

    $this->db->load_course_descriptive_data(null, $course_id);

  }

  // Should we re-cache the course inventory?  If there have been any changes
  // to it, then we will see that in a GLOBALS variable...
  if ($GLOBALS ["cache_course_inventory"] == true) 
   {
    $_SESSION ["fp_cache_course_inventory"] = serialize($GLOBALS ["fp_course_inventory"]);
  }


}