original_string: public static function get_competencies_by_userevidenceid($userevidenceid) {
          global $DB;
          $sql = "SELECT c.*
                    FROM {" . self::TABLE . "} uec
                    JOIN {" . competency::TABLE . "} c
                      ON uec.userevidenceid = ?
                     AND uec.competencyid = c.id
                ORDER BY c.shortname";
          $competencies = array();
          $records = $DB->get_recordset_sql($sql, array($userevidenceid));
          foreach ($records as $record) {
              $competencies[] = new competency(0, $record);
          }
          $records->close();
          return $competencies;
      }
code: public static function get_competencies_by_userevidenceid($userevidenceid) {
          global $DB;
          $sql = "SELECT c.*
                    FROM {" . self::TABLE . "} uec
                    JOIN {" . competency::TABLE . "} c
                      ON uec.userevidenceid = ?
                     AND uec.competencyid = c.id
                ORDER BY c.shortname";
          $competencies = array();
          $records = $DB->get_recordset_sql($sql, array($userevidenceid));
          foreach ($records as $record) {
              $competencies[] = new competency(0, $record);
          }
          $records->close();
          return $competencies;
      }
code_tokens: public static function get_competencies_by_userevidenceid ( $ userevidenceid ) { global $ DB ; $ sql = "SELECT c.*
                    FROM {" . self :: TABLE . "} uec
                    JOIN {" . competency :: TABLE . "} c
                      ON uec.userevidenceid = ?
                     AND uec.competencyid = c.id
                ORDER BY c.shortname" ; $ competencies = array ( ) ; $ records = $ DB -> get_recordset_sql ( $ sql , array ( $ userevidenceid ) ) ; foreach ( $ records as $ record ) { $ competencies [ ] = new competency ( 0 , $ record ) ; } $ records -> close ( ) ; return $ competencies ; }
docstring: Get competencies by user evidence ID.
  
  @param  int $userevidenceid The user evidence ID.
  @return competency[]
docstring_tokens: Get competencies by user evidence ID .