MIDDAG for Moodle

digitalmanagerguru_restapi

Table of Contents

Constants

URL_BASE  = 'https://digitalmanager.guru/api/v2'

Properties

$client  : http_client

Methods

__construct()  : mixed
product()  : mixed
Retrieves product information by its unique identifier.
products()  : mixed
Retrieves a list of products based on the provided parameters.
test()  : bool
Executes the products method and verifies its execution outcome.
transaction()  : mixed
Retrieves transactions by their unique identifier.
transactions()  : mixed
Retrieves a list of transactions from the specified endpoint.

Constants

Properties

Methods

product()

Retrieves product information by its unique identifier.

public product(mixed $id[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$id : mixed

The unique identifier of the product. This parameter is required.

$params : array<string|int, mixed> = []

Additional parameters to filter or modify the request. This parameter is optional.

Tags
throws
Exception

if the $id parameter is missing or if the request encounters an error

Return values
mixed

the product data if the request is successful

products()

Retrieves a list of products based on the provided parameters.

public products([array<string|int, mixed> $params = [] ]) : mixed
Parameters
$params : array<string|int, mixed> = []

An associative array of parameters to filter the products. Example keys may include filters, pagination, or sorting options.

Tags
throws
Exception

throws an exception if there is an error in the API response or data is missing

Return values
mixed

returns the product data retrieved from the API

test()

Executes the products method and verifies its execution outcome.

public test() : bool
Return values
bool

returns true if the products method executes successfully, otherwise returns false in case of an exception

transaction()

Retrieves transactions by their unique identifier.

public transaction(mixed $id[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$id : mixed

The unique identifier of the transaction. This parameter is required.

$params : array<string|int, mixed> = []

Additional parameters to filter or modify the request. This parameter is optional.

Tags
throws
Exception

if the $id parameter is missing or if the request encounters an error

Return values
mixed

the transaction data if the request is successful

transactions()

Retrieves a list of transactions from the specified endpoint.

public transactions(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Tags
throws
Exception
Return values
mixed

the response from the API containing the transaction details


        
On this page

Search results