original_string: protected function user_can_access_course($user, $course, $capability) {
          if (!isset($this->courseaccesscache[$course->id][$user->id][$capability])) {
              $this->courseaccesscache[$course->id][$user->id][$capability] = can_access_course($course, $user, $capability, true);
          }
          return $this->courseaccesscache[$course->id][$user->id][$capability];
      }
code: protected function user_can_access_course($user, $course, $capability) {
          if (!isset($this->courseaccesscache[$course->id][$user->id][$capability])) {
              $this->courseaccesscache[$course->id][$user->id][$capability] = can_access_course($course, $user, $capability, true);
          }
          return $this->courseaccesscache[$course->id][$user->id][$capability];
      }
code_tokens: protected function user_can_access_course ( $ user , $ course , $ capability ) { if ( ! isset ( $ this -> courseaccesscache [ $ course -> id ] [ $ user -> id ] [ $ capability ] ) ) { $ this -> courseaccesscache [ $ course -> id ] [ $ user -> id ] [ $ capability ] = can_access_course ( $ course , $ user , $ capability , true ) ; } return $ this -> courseaccesscache [ $ course -> id ] [ $ user -> id ] [ $ capability ] ; }
docstring: Determines a user's access to a course with a given capability, using cached results where possible.
  
  @since 3.2.0
  @param \stdClass $user the user record.
  @param \stdClass $course the course record.
  @param string $capability the capability to check.
  @return bool true if the user can access the course with the specified capability, false otherwise.
docstring_tokens: Determines a user s access to a course with a given capability using cached results where possible .