original_string: public function can_access_course($courseid) {
          $this->init_course_access();
          if (!array_key_exists($courseid, $this->courseaccess)) {
              $this->courseaccess[$courseid] = can_access_course($this->get_course($courseid)) ? 1 : 0;
              $this->cachechangedcourse = true;
          }
          return $this->courseaccess[$courseid];
      }
code: public function can_access_course($courseid) {
          $this->init_course_access();
          if (!array_key_exists($courseid, $this->courseaccess)) {
              $this->courseaccess[$courseid] = can_access_course($this->get_course($courseid)) ? 1 : 0;
              $this->cachechangedcourse = true;
          }
          return $this->courseaccess[$courseid];
      }
code_tokens: public function can_access_course ( $ courseid ) { $ this -> init_course_access ( ) ; if ( ! array_key_exists ( $ courseid , $ this -> courseaccess ) ) { $ this -> courseaccess [ $ courseid ] = can_access_course ( $ this -> get_course ( $ courseid ) ) ? 1 : 0 ; $ this -> cachechangedcourse = true ; } return $ this -> courseaccess [ $ courseid ] ; }
docstring: Checks if current user has access to the course
  
  This method calls global function {@link can_access_course} and caches results
  
  @param int $courseid
  @return bool
docstring_tokens: Checks if current user has access to the course