original_string: protected function get_all_courses($limitcourseids) {
          global $DB;
  
          if ($limitcourseids) {
              list ($coursesql, $courseparams) = $DB->get_in_or_equal($limitcourseids);
              $coursesql = 'id ' . $coursesql;
          } else {
              $coursesql = '';
              $courseparams = [];
          }
  
          // Get courses using the same list of fields from enrol_get_my_courses.
          return $DB->get_records_select('course', $coursesql, $courseparams, '',
              'id, category, sortorder, shortname, fullname, idnumber, startdate, visible, ' .
              'groupmode, groupmodeforce, cacherev');
      }
code: protected function get_all_courses($limitcourseids) {
          global $DB;
  
          if ($limitcourseids) {
              list ($coursesql, $courseparams) = $DB->get_in_or_equal($limitcourseids);
              $coursesql = 'id ' . $coursesql;
          } else {
              $coursesql = '';
              $courseparams = [];
          }
  
          // Get courses using the same list of fields from enrol_get_my_courses.
          return $DB->get_records_select('course', $coursesql, $courseparams, '',
              'id, category, sortorder, shortname, fullname, idnumber, startdate, visible, ' .
              'groupmode, groupmodeforce, cacherev');
      }
code_tokens: protected function get_all_courses ( $ limitcourseids ) { global $ DB ; if ( $ limitcourseids ) { list ( $ coursesql , $ courseparams ) = $ DB -> get_in_or_equal ( $ limitcourseids ) ; $ coursesql = 'id ' . $ coursesql ; } else { $ coursesql = '' ; $ courseparams = [ ] ; } // Get courses using the same list of fields from enrol_get_my_courses. return $ DB -> get_records_select ( 'course' , $ coursesql , $ courseparams , '' , 'id, category, sortorder, shortname, fullname, idnumber, startdate, visible, ' . 'groupmode, groupmodeforce, cacherev' ) ; }
docstring: Get a list of all courses limited by ids if required.
  
  @param array|false $limitcourseids An array of course ids to limit the search to. False for no limiting.
  @return array
docstring_tokens: Get a list of all courses limited by ids if required .