public function getCourseCollection($refresh = false)
 {
     if ($refresh || !isset($this->course_collection)) {
         $course_category = $this->getCategory();
         $this->course_collection = false;
         if ($course_category) {
             $this->course_collection = GcrCourseCollection::getInstance($course_category);
         }
     }
     return $this->course_collection;
 }
 public function getCourseCollections($parent_category_id = false)
 {
     $course_collections = array();
     $sql = 'SELECT * FROM ' . $this->short_name . '.mdl_course_categories where ';
     $params = array();
     if ($parent_category_id) {
         $sql .= 'parent = ? AND ';
         $params[] = $parent_category_id;
     }
     $sql .= '(idnumber IS NOT NULL OR idnumber <> ?)';
     $params[] = '';
     $mdl_course_categories = $this->gcQuery($sql, $params);
     foreach ($mdl_course_categories as $mdl_course_category) {
         $course_category = new GcrMdlCourseCategory($mdl_course_category, $this);
         $course_collections[] = GcrCourseCollection::getInstance($course_category);
     }
     return $course_collections;
 }
 public function getCourseCollection()
 {
     return GcrCourseCollection::getInstance($this);
 }