original_string: public static function get_competency_by_usercompetencyid($id) {
          global $DB;
          $sql = "SELECT c.*
                    FROM {" . self::TABLE . "} uc
                    JOIN {" . competency::TABLE . "} c
                      ON c.id = uc.competencyid
                   WHERE uc.id = ?";
          $record = $DB->get_record_sql($sql, array($id), MUST_EXIST);
          return new competency(0, $record);
      }
code: public static function get_competency_by_usercompetencyid($id) {
          global $DB;
          $sql = "SELECT c.*
                    FROM {" . self::TABLE . "} uc
                    JOIN {" . competency::TABLE . "} c
                      ON c.id = uc.competencyid
                   WHERE uc.id = ?";
          $record = $DB->get_record_sql($sql, array($id), MUST_EXIST);
          return new competency(0, $record);
      }
code_tokens: public static function get_competency_by_usercompetencyid ( $ id ) { global $ DB ; $ sql = "SELECT c.*
                    FROM {" . self :: TABLE . "} uc
                    JOIN {" . competency :: TABLE . "} c
                      ON c.id = uc.competencyid
                   WHERE uc.id = ?" ; $ record = $ DB -> get_record_sql ( $ sql , array ( $ id ) , MUST_EXIST ) ; return new competency ( 0 , $ record ) ; }
docstring: Fetch a competency by user competency ID.
  
  This is a convenience method to attempt to efficiently fetch a competency when
  the only information we have is the user_competency ID, in evidence for instance.
  
  @param  int $id The user competency ID.
  @return competency
docstring_tokens: Fetch a competency by user competency ID .