CustomApiMethod
in package
Class CustomApiMethod
This class can be used to implement custom methods without any hassle. It is useful if you don't want to do anything besides sending the request and reading the response.
Tags
Table of Contents
Methods
- __construct() : mixed
- Instantiates new instance of the CustomApiMethod.
- __invoke() : array<int|string, mixed>|mixed
- Sends the request, returns the response.
- useRouteAsUri() : $this
- Use provided route as if it was full URL.
Methods
__construct()
Instantiates new instance of the CustomApiMethod.
public
__construct(string $method, string $route) : mixed
Parameters
- $method : string
- $route : string
__invoke()
Sends the request, returns the response.
public
__invoke(RequestSenderInterface $sender[, array<int|string, mixed>|object $data = [] ]) : array<int|string, mixed>|mixed
Parameters
- $sender : RequestSenderInterface
- $data : array<int|string, mixed>|object = []
Tags
Return values
array<int|string, mixed>|mixeduseRouteAsUri()
Use provided route as if it was full URL.
public
useRouteAsUri() : $this