Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 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