Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

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

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.

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

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

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

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.

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

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

return: string