public static function get_entries_by_letter($id, $letter, $from, $limit, $options) {
        $params = self::validate_parameters(self::get_entries_by_letter_parameters(), array(
            'id' => $id,
            'letter' => $letter,
            'from' => $from,
            'limit' => $limit,
            'options' => $options,
        ));
        $id = $params['id'];
        $letter = $params['letter'];
        $from = $params['from'];
        $limit = $params['limit'];
        $options = $params['options'];
        $warnings = array();

        // Get and validate the glossary.
        list($glossary, $context) = self::validate_glossary($id);

        // Validate the mode.
        $modes = self::get_browse_modes_from_display_format($glossary->displayformat);
        if (!in_array('letter', $modes)) {
            throw new invalid_parameter_exception('invalidbrowsemode');
        }

        $entries = array();
        list($records, $count) = glossary_get_entries_by_letter($glossary, $context, $letter, $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
        );
    }
public static function get_entries_by_letter($id, $letter, $from, $limit, $options) {
        $params = self::validate_parameters(self::get_entries_by_letter_parameters(), array(
            'id' => $id,
            'letter' => $letter,
            'from' => $from,
            'limit' => $limit,
            'options' => $options,
        ));
        $id = $params['id'];
        $letter = $params['letter'];
        $from = $params['from'];
        $limit = $params['limit'];
        $options = $params['options'];
        $warnings = array();

        // Get and validate the glossary.
        list($glossary, $context) = self::validate_glossary($id);

        // Validate the mode.
        $modes = self::get_browse_modes_from_display_format($glossary->displayformat);
        if (!in_array('letter', $modes)) {
            throw new invalid_parameter_exception('invalidbrowsemode');
        }

        $entries = array();
        list($records, $count) = glossary_get_entries_by_letter($glossary, $context, $letter, $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
        );
    }
public static function get_entries_by_letter ( $ id , $ letter , $ from , $ limit , $ options ) { $ params = self :: validate_parameters ( self :: get_entries_by_letter_parameters ( ) , array ( 'id' => $ id , 'letter' => $ letter , 'from' => $ from , 'limit' => $ limit , 'options' => $ options , ) ) ; $ id = $ params [ 'id' ] ; $ letter = $ params [ 'letter' ] ; $ from = $ params [ 'from' ] ; $ limit = $ params [ 'limit' ] ; $ options = $ params [ 'options' ] ; $ warnings = array ( ) ; // Get and validate the glossary. list ( $ glossary , $ context ) = self :: validate_glossary ( $ id ) ; // Validate the mode. $ modes = self :: get_browse_modes_from_display_format ( $ glossary -> displayformat ) ; if ( ! in_array ( 'letter' , $ modes ) ) { throw new invalid_parameter_exception ( 'invalidbrowsemode' ) ; } $ entries = array ( ) ; list ( $ records , $ count ) = glossary_get_entries_by_letter ( $ glossary , $ context , $ letter , $ 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 ) ; }
Browse a glossary entries by letter.

@param int $id The glossary ID.
@param string $letter A letter, or a special keyword.
@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
Browse a glossary entries by letter .