original_string: protected function load_category($categoryid) {
          global $DB;
          $category = $DB->get_record('course_categories', array('id' => $categoryid));
          if (!$category) {
              throw new moodle_exception('unknowncategory');
          }
          $this->_categories[$category->id] = $category;
          $parentcategoryids = explode('/', trim($category->path, '/'));
          array_pop($parentcategoryids);
          foreach (array_reverse($parentcategoryids) as $catid) {
              $this->_categories[$catid] = null;
          }
      }
code: protected function load_category($categoryid) {
          global $DB;
          $category = $DB->get_record('course_categories', array('id' => $categoryid));
          if (!$category) {
              throw new moodle_exception('unknowncategory');
          }
          $this->_categories[$category->id] = $category;
          $parentcategoryids = explode('/', trim($category->path, '/'));
          array_pop($parentcategoryids);
          foreach (array_reverse($parentcategoryids) as $catid) {
              $this->_categories[$catid] = null;
          }
      }
code_tokens: protected function load_category ( $ categoryid ) { global $ DB ; $ category = $ DB -> get_record ( 'course_categories' , array ( 'id' => $ categoryid ) ) ; if ( ! $ category ) { throw new moodle_exception ( 'unknowncategory' ) ; } $ this -> _categories [ $ category -> id ] = $ category ; $ parentcategoryids = explode ( '/' , trim ( $ category -> path , '/' ) ) ; array_pop ( $ parentcategoryids ) ; foreach ( array_reverse ( $ parentcategoryids ) as $ catid ) { $ this -> _categories [ $ catid ] = null ; } }
docstring: Loads the requested category into the pages categories array.
  
  @param int $categoryid
  @throws moodle_exception
docstring_tokens: Loads the requested category into the pages categories array .