original_string: public static function search($search, $downloadable, $options) {
          try {
              return api::get_courses($search, $downloadable, !$downloadable, $options);
          } catch (moodle_exception $e) {
              \core\notification::add(get_string('errorcourselisting', 'block_community', $e->getMessage()),
                  \core\output\notification::NOTIFY_ERROR);
              return [[], 0];
          }
      }
code: public static function search($search, $downloadable, $options) {
          try {
              return api::get_courses($search, $downloadable, !$downloadable, $options);
          } catch (moodle_exception $e) {
              \core\notification::add(get_string('errorcourselisting', 'block_community', $e->getMessage()),
                  \core\output\notification::NOTIFY_ERROR);
              return [[], 0];
          }
      }
code_tokens: public static function search ( $ search , $ downloadable , $ options ) { try { return api :: get_courses ( $ search , $ downloadable , ! $ downloadable , $ options ) ; } catch ( moodle_exception $ e ) { \ core \ notification :: add ( get_string ( 'errorcourselisting' , 'block_community' , $ e -> getMessage ( ) ) , \ core \ output \ notification :: NOTIFY_ERROR ) ; return [ [ ] , 0 ] ; } }
docstring: Search for courses
  
  For the list of fields returned for each course see {@link communication::get_courses}
  
  @param string $search search string
  @param bool $downloadable true - return downloadable courses, false - return enrollable courses
  @param array|\stdClass $options other options from the list of allowed options:
  'ids', 'sitecourseids', 'coverage', 'licenceshortname', 'subject', 'audience',
  'educationallevel', 'language', 'orderby', 'givememore', 'allsitecourses'
  @return array of two elements: [$courses, $coursetotal]
docstring_tokens: Search for courses