Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 258 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: brickfieldconnect  - X-Ref

Class brickfieldconnect. Contains all function to connect to Brickfield external services.

is_registered()   X-Ref
Object method to test whether site is already registered.

return: bool

update_registration(string $apikey, string $secretkey)   X-Ref
Update registration of this site.

param: string $apikey The API key to use for the registration attempt
param: string $secretkey The secret key to use
return: bool

send_summary()   X-Ref
Send the summary data to Brickfield.

return: bool

get_url_for_command(array $command)   X-Ref
Get the URL required for the command.

param: array $command The command to call, for example see self::ACTION_REGISTER
return: string The complete URL

call(array $command, $params = '')   X-Ref
Call the specified command.

param: array $command The command to call, for example see self::ACTION_REGISTER
param: array|string $params The params provided to the call
return: string The response body

get_common_headers()   X-Ref
Get the common headers used for all calls to the Brickfields endpoints.

return: array

set_headers(array $headers)   X-Ref
Set headers on the request from the specified list of headers.

param: array $headers An array of header name => value

has_registration_key()   X-Ref
Whether the site currently has a registration key stored.

return: bool

get_siteurl()   X-Ref
Get a normalised URL for the site.

return: string

get_registration_id_for_credentials(string $apikey = null, string $secretkey = null)   X-Ref
Get the registration ID for the given set of credentials.

param: null|string $apikey The API key to use for the registration attempt
param: null|string $secretkey The secret key to use
return: null|string The registration ID if registration was successful, or null if not

get_baseapiuri()   X-Ref
Get the check registration API URI.

return: string