original_string: public static function fetch_all_available($courseid) {
          global $CFG, $DB;
  
          $result = array();
          $params = array($courseid);
          $sql = "SELECT go.*
                    FROM {grade_outcomes} go, {grade_outcomes_courses} goc
                   WHERE go.id = goc.outcomeid AND goc.courseid = ?
                ORDER BY go.id ASC";
  
          if ($datas = $DB->get_records_sql($sql, $params)) {
              foreach($datas as $data) {
                  $instance = new grade_outcome();
                  grade_object::set_properties($instance, $data);
                  $result[$instance->id] = $instance;
              }
          }
          return $result;
      }
code: public static function fetch_all_available($courseid) {
          global $CFG, $DB;
  
          $result = array();
          $params = array($courseid);
          $sql = "SELECT go.*
                    FROM {grade_outcomes} go, {grade_outcomes_courses} goc
                   WHERE go.id = goc.outcomeid AND goc.courseid = ?
                ORDER BY go.id ASC";
  
          if ($datas = $DB->get_records_sql($sql, $params)) {
              foreach($datas as $data) {
                  $instance = new grade_outcome();
                  grade_object::set_properties($instance, $data);
                  $result[$instance->id] = $instance;
              }
          }
          return $result;
      }
code_tokens: public static function fetch_all_available ( $ courseid ) { global $ CFG , $ DB ; $ result = array ( ) ; $ params = array ( $ courseid ) ; $ sql = "SELECT go.*
                    FROM {grade_outcomes} go, {grade_outcomes_courses} goc
                   WHERE go.id = goc.outcomeid AND goc.courseid = ?
                ORDER BY go.id ASC" ; if ( $ datas = $ DB -> get_records_sql ( $ sql , $ params ) ) { foreach ( $ datas as $ data ) { $ instance = new grade_outcome ( ) ; grade_object :: set_properties ( $ instance , $ data ) ; $ result [ $ instance -> id ] = $ instance ; } } return $ result ; }
docstring: Static method that returns all outcomes available in course
  
  @static
  @param int $courseid
  @return array
docstring_tokens: Static method that returns all outcomes available in course