original_string: protected function exists($shortname = null) {
          global $DB;
          if (is_null($shortname)) {
              $shortname = $this->shortname;
          }
          if (!empty($shortname) || is_numeric($shortname)) {
              return $DB->record_exists('course', array('shortname' => $shortname));
          }
          return false;
      }
code: protected function exists($shortname = null) {
          global $DB;
          if (is_null($shortname)) {
              $shortname = $this->shortname;
          }
          if (!empty($shortname) || is_numeric($shortname)) {
              return $DB->record_exists('course', array('shortname' => $shortname));
          }
          return false;
      }
code_tokens: protected function exists ( $ shortname = null ) { global $ DB ; if ( is_null ( $ shortname ) ) { $ shortname = $ this -> shortname ; } if ( ! empty ( $ shortname ) || is_numeric ( $ shortname ) ) { return $ DB -> record_exists ( 'course' , array ( 'shortname' => $ shortname ) ) ; } return false ; }
docstring: Return whether the course exists or not.
  
  @param string $shortname the shortname to use to check if the course exists. Falls back on $this->shortname if empty.
  @return bool
docstring_tokens: Return whether the course exists or not .