Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Favourites API

From MoodleDocs

Overview

The favourites API allows you to favourite items for a given user, a notion akin to adding a web page to favourites (or bookmarks) in your browser, or marking someone in your contacts as a favourite. The API provides a means to create, read, update and delete favourites, allowing any component to favourite arbitrary items as they see fit.

Favourites API usage

An item can be anything and is identified by a {component, itemtype} pair. The component must be a valid frankenstyle component name and should be the name of the component wishing to store the favourite. The itemtype can be any identifying string, provided it is unique within the respective component. E.g. {'core_course', 'courses'} is used in core to as a key to identify those courses which have been starred for a given user.

Additionally, the API supports the marking of items as favourites in different contexts, using a 'contextid' parameter.