Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Glossary module external API.

Copyright: 2015 Costantino Cito <ccito@cvaconsulting.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1563 lines (67 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

mod_glossary_external:: (49 methods):
  get_browse_modes_from_display_format()
  get_entry_return_structure()
  fill_entry_details()
  validate_glossary()
  get_glossaries_by_courses_parameters()
  get_glossaries_by_courses()
  get_glossaries_by_courses_returns()
  view_glossary_parameters()
  view_glossary()
  view_glossary_returns()
  view_entry_parameters()
  view_entry()
  view_entry_returns()
  get_entries_by_letter_parameters()
  get_entries_by_letter()
  get_entries_by_letter_returns()
  get_entries_by_date_parameters()
  get_entries_by_date()
  get_entries_by_date_returns()
  get_categories_parameters()
  get_categories()
  get_categories_returns()
  get_entries_by_category_parameters()
  get_entries_by_category()
  get_entries_by_category_returns()
  get_authors_parameters()
  get_authors()
  get_authors_returns()
  get_entries_by_author_parameters()
  get_entries_by_author()
  get_entries_by_author_returns()
  get_entries_by_author_id_parameters()
  get_entries_by_author_id()
  get_entries_by_author_id_returns()
  get_entries_by_search_parameters()
  get_entries_by_search()
  get_entries_by_search_returns()
  get_entries_by_term_parameters()
  get_entries_by_term()
  get_entries_by_term_returns()
  get_entries_to_approve_parameters()
  get_entries_to_approve()
  get_entries_to_approve_returns()
  get_entry_by_id_parameters()
  get_entry_by_id()
  get_entry_by_id_returns()
  add_entry_parameters()
  add_entry()
  add_entry_returns()


Class: mod_glossary_external  - X-Ref

Glossary module external functions.

get_browse_modes_from_display_format($format)   X-Ref
Get the browse modes from the display format.

This returns some of the terms that can be used when reporting a glossary being viewed.

param: string $format The display format of the glossary.
return: array Containing some of all of the following: letter, cat, date, author.

get_entry_return_structure($includecat = false)   X-Ref
Get the return value of an entry.

param: bool $includecat Whether the definition should include category info.
return: external_definition

fill_entry_details($entry, $context)   X-Ref
Fill in an entry object.

This adds additional required fields for the external function to return.

param: stdClass $entry   The entry.
param: context  $context The context the entry belongs to.
return: void

validate_glossary($id)   X-Ref
Validate a glossary via ID.

param: int $id The glossary ID.
return: array Contains glossary, context, course and cm.

get_glossaries_by_courses_parameters()   X-Ref
Describes the parameters for get_glossaries_by_courses.

return: external_function_parameters

get_glossaries_by_courses($courseids = array()   X-Ref
Returns a list of glossaries in a provided list of courses.

If no list is provided all glossaries that the user can view will be returned.

param: array $courseids the course IDs.
return: array of glossaries

get_glossaries_by_courses_returns()   X-Ref
Describes the get_glossaries_by_courses return value.

return: external_single_structure

view_glossary_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

view_glossary($id, $mode)   X-Ref
Notify that the course module was viewed.

param: int $id The glossary instance ID.
param: string $mode The view mode.
return: array of warnings and status result

view_glossary_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

view_entry_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

view_entry($id)   X-Ref
Notify that the entry was viewed.

param: int $id The entry ID.
return: array of warnings and status result

view_entry_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_letter_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_letter($id, $letter, $from, $limit, $options)   X-Ref
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.

get_entries_by_letter_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_date_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_date($id, $order, $sort, $from, $limit, $options)   X-Ref
Browse a glossary entries by date.

param: int $id The glossary ID.
param: string $order The way to order the records.
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.

get_entries_by_date_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_categories_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_categories($id, $from, $limit)   X-Ref
Get the categories of a glossary.

param: int $id The glossary ID.
param: int $from Start returning records from here.
param: int $limit Number of records to return.
return: array Containing count, categories and warnings.

get_categories_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_category_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_category($id, $categoryid, $from, $limit, $options)   X-Ref
Browse a glossary entries by category.

param: int $id The glossary ID.
param: int $categoryid The category ID.
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.

get_entries_by_category_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_authors_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_authors($id, $from, $limit, $options)   X-Ref
Get the authors of a glossary.

param: int $id The glossary ID.
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, authors and warnings.

get_authors_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_author_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_author($id, $letter, $field, $sort, $from, $limit, $options)   X-Ref
Browse a glossary entries by author.

param: int $id The glossary ID.
param: string $letter A letter, or a special keyword.
param: string $field The field to search from.
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.

get_entries_by_author_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_author_id_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_author_id($id, $authorid, $order, $sort, $from, $limit, $options)   X-Ref
Browse a glossary entries by author.

param: int $id The glossary ID.
param: int $authorid The author ID.
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.

get_entries_by_author_id_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_search_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_search($id, $query, $fullsearch, $order, $sort, $from, $limit, $options)   X-Ref
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.

get_entries_by_search_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_by_term_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_by_term($id, $term, $from, $limit, $options)   X-Ref
Browse a glossary entries using a term matching the concept or alias.

param: int $id The glossary ID.
param: string $term The term.
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.

get_entries_by_term_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entries_to_approve_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entries_to_approve($id, $letter, $order, $sort, $from, $limit)   X-Ref
Browse a glossary entries using a term matching the concept or alias.

param: int $id The glossary ID.
param: string $letter A letter, or a special keyword.
param: string $order The way to order the records.
param: string $sort The direction of the order.
param: int $from Start returning records from here.
param: int $limit Number of records to return.
return: array Containing count, entries and warnings.

get_entries_to_approve_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

get_entry_by_id_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

get_entry_by_id($id)   X-Ref
Get an entry.

param: int $id The entry ID.
return: array Containing entry and warnings.

get_entry_by_id_returns()   X-Ref
Returns the description of the external function return value.

return: external_description

add_entry_parameters()   X-Ref
Returns the description of the external function parameters.

return: external_function_parameters

add_entry($glossaryid, $concept, $definition, $definitionformat, $options = array()   X-Ref
Add a new entry to a given glossary.

param: int $glossaryid the glosary id
param: string $concept    the glossary concept
param: string $definition the concept definition
param: int $definitionformat the concept definition format
param: array  $options    additional settings
return: array Containing entry and warnings.

add_entry_returns()   X-Ref
Returns the description of the external function return value.

return: external_description