original_string: public static function get_entries_by_search($id, $query, $fullsearch, $order, $sort, $from, $limit, $options) {
          $params = self::validate_parameters(self::get_entries_by_search_parameters(), array(
              'id' => $id,
              'query' => $query,
              'fullsearch' => $fullsearch,
              'order' => core_text::strtoupper($order),
              'sort' => core_text::strtoupper($sort),
              'from' => $from,
              'limit' => $limit,
              'options' => $options,
          ));
          $id = $params['id'];
          $query = $params['query'];
          $fullsearch = $params['fullsearch'];
          $order = $params['order'];
          $sort = $params['sort'];
          $from = $params['from'];
          $limit = $params['limit'];
          $options = $params['options'];
          $warnings = array();
  
          if (!in_array($order, array('CONCEPT', 'CREATION', 'UPDATE'))) {
              throw new invalid_parameter_exception('invalidorder');
          } else if (!in_array($sort, array('ASC', 'DESC'))) {
              throw new invalid_parameter_exception('invalidsort');
          }
  
          // Get and validate the glossary.
          list($glossary, $context) = self::validate_glossary($id);
  
          // Fetching the entries.
          $entries = array();
          list($records, $count) = glossary_get_entries_by_search($glossary, $context, $query, $fullsearch, $order, $sort, $from,
              $limit, $options);
          foreach ($records as $key => $record) {
              self::fill_entry_details($record, $context);
              $entries[] = $record;
          }
  
          return array(
              'count' => $count,
              'entries' => $entries,
              'ratinginfo' => \core_rating\external\util::get_rating_info($glossary, $context, 'mod_glossary', 'entry', $entries),
              'warnings' => $warnings
          );
      }
code: public static function get_entries_by_search($id, $query, $fullsearch, $order, $sort, $from, $limit, $options) {
          $params = self::validate_parameters(self::get_entries_by_search_parameters(), array(
              'id' => $id,
              'query' => $query,
              'fullsearch' => $fullsearch,
              'order' => core_text::strtoupper($order),
              'sort' => core_text::strtoupper($sort),
              'from' => $from,
              'limit' => $limit,
              'options' => $options,
          ));
          $id = $params['id'];
          $query = $params['query'];
          $fullsearch = $params['fullsearch'];
          $order = $params['order'];
          $sort = $params['sort'];
          $from = $params['from'];
          $limit = $params['limit'];
          $options = $params['options'];
          $warnings = array();
  
          if (!in_array($order, array('CONCEPT', 'CREATION', 'UPDATE'))) {
              throw new invalid_parameter_exception('invalidorder');
          } else if (!in_array($sort, array('ASC', 'DESC'))) {
              throw new invalid_parameter_exception('invalidsort');
          }
  
          // Get and validate the glossary.
          list($glossary, $context) = self::validate_glossary($id);
  
          // Fetching the entries.
          $entries = array();
          list($records, $count) = glossary_get_entries_by_search($glossary, $context, $query, $fullsearch, $order, $sort, $from,
              $limit, $options);
          foreach ($records as $key => $record) {
              self::fill_entry_details($record, $context);
              $entries[] = $record;
          }
  
          return array(
              'count' => $count,
              'entries' => $entries,
              'ratinginfo' => \core_rating\external\util::get_rating_info($glossary, $context, 'mod_glossary', 'entry', $entries),
              'warnings' => $warnings
          );
      }
code_tokens: public static function get_entries_by_search ( $ id , $ query , $ fullsearch , $ order , $ sort , $ from , $ limit , $ options ) { $ params = self :: validate_parameters ( self :: get_entries_by_search_parameters ( ) , array ( 'id' => $ id , 'query' => $ query , 'fullsearch' => $ fullsearch , 'order' => core_text :: strtoupper ( $ order ) , 'sort' => core_text :: strtoupper ( $ sort ) , 'from' => $ from , 'limit' => $ limit , 'options' => $ options , ) ) ; $ id = $ params [ 'id' ] ; $ query = $ params [ 'query' ] ; $ fullsearch = $ params [ 'fullsearch' ] ; $ order = $ params [ 'order' ] ; $ sort = $ params [ 'sort' ] ; $ from = $ params [ 'from' ] ; $ limit = $ params [ 'limit' ] ; $ options = $ params [ 'options' ] ; $ warnings = array ( ) ; if ( ! in_array ( $ order , array ( 'CONCEPT' , 'CREATION' , 'UPDATE' ) ) ) { throw new invalid_parameter_exception ( 'invalidorder' ) ; } else if ( ! in_array ( $ sort , array ( 'ASC' , 'DESC' ) ) ) { throw new invalid_parameter_exception ( 'invalidsort' ) ; } // Get and validate the glossary. list ( $ glossary , $ context ) = self :: validate_glossary ( $ id ) ; // Fetching the entries. $ entries = array ( ) ; list ( $ records , $ count ) = glossary_get_entries_by_search ( $ glossary , $ context , $ query , $ fullsearch , $ order , $ sort , $ from , $ limit , $ options ) ; foreach ( $ records as $ key => $ record ) { self :: fill_entry_details ( $ record , $ context ) ; $ entries [ ] = $ record ; } return array ( 'count' => $ count , 'entries' => $ entries , 'ratinginfo' => \ core_rating \ external \ util :: get_rating_info ( $ glossary , $ context , 'mod_glossary' , 'entry' , $ entries ) , 'warnings' => $ warnings ) ; }
docstring: Browse a glossary entries using the search.
  
  @param int $id The glossary ID.
  @param string $query The search query.
  @param bool $fullsearch Whether or not full search is required.
  @param string $order The way to order the results.
  @param string $sort The direction of the order.
  @param int $from Start returning records from here.
  @param int $limit Number of records to return.
  @param array $options Array of options.
  @return array Containing count, entries and warnings.
  @since Moodle 3.1
  @throws moodle_exception
  @throws invalid_parameter_exception
docstring_tokens: Browse a glossary entries using the search .