original_string: public static function list_course_module_competencies($cmid) {
          global $DB;
  
          $sql = 'SELECT coursemodcomp.*
                    FROM {' . self::TABLE . '} coursemodcomp
                    JOIN {' . competency::TABLE . '} comp
                      ON coursemodcomp.competencyid = comp.id
                   WHERE coursemodcomp.cmid = ?
                   ORDER BY coursemodcomp.sortorder ASC';
          $params = array($cmid);
  
          $results = $DB->get_recordset_sql($sql, $params);
          $instances = array();
          foreach ($results as $result) {
              array_push($instances, new course_module_competency(0, $result));
          }
          $results->close();
  
          return $instances;
      }
code: public static function list_course_module_competencies($cmid) {
          global $DB;
  
          $sql = 'SELECT coursemodcomp.*
                    FROM {' . self::TABLE . '} coursemodcomp
                    JOIN {' . competency::TABLE . '} comp
                      ON coursemodcomp.competencyid = comp.id
                   WHERE coursemodcomp.cmid = ?
                   ORDER BY coursemodcomp.sortorder ASC';
          $params = array($cmid);
  
          $results = $DB->get_recordset_sql($sql, $params);
          $instances = array();
          foreach ($results as $result) {
              array_push($instances, new course_module_competency(0, $result));
          }
          $results->close();
  
          return $instances;
      }
code_tokens: public static function list_course_module_competencies ( $ cmid ) { global $ DB ; $ sql = 'SELECT coursemodcomp.*
                    FROM {' . self :: TABLE . '} coursemodcomp
                    JOIN {' . competency :: TABLE . '} comp
                      ON coursemodcomp.competencyid = comp.id
                   WHERE coursemodcomp.cmid = ?
                   ORDER BY coursemodcomp.sortorder ASC' ; $ params = array ( $ cmid ) ; $ results = $ DB -> get_recordset_sql ( $ sql , $ params ) ; $ instances = array ( ) ; foreach ( $ results as $ result ) { array_push ( $ instances , new course_module_competency ( 0 , $ result ) ) ; } $ results -> close ( ) ; return $ instances ; }
docstring: List the course_module_competencies in this course module.
  
  @param int $cmid The course module id
  @return course_module_competency[]
docstring_tokens: List the course_module_competencies in this course module .