CustomFieldsApi
extends BaseApi
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- BaseApi constructor.
- all() : array{message: string, data: array{key: string, value: string, defaultValue: string, strict: bool}}
- Fetch all custom fields <code> <?php $response = $olc->customFields()->all(); ?> </code>
- allPaginated() : array<string|int, mixed>
- Fetch all paginated custom fields <code> <?php $response = $olc->customFields()->allPaginated([ //'page' => 1, //'perPage' => 10, ]); ?> </code>
- create() : array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}}
- Create a custom field <code> <?php $response = $olc->customFields()->create('Wife Name'); ?> </code>
- delete() : array<string|int, mixed>
- Removes custom field by the given id <code> <?php $response = $olc->customFields()->delete(1); ?> </code>
- get() : array<string|int, mixed>
- Get custom field by the given id <code> <?php $response = $olc->customFields()->get(1); ?> </code>
- update() : array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}}
- Updates a custom field <code> <?php $response = $olc->customFields()->update(1, 'Wife Name'); ?> </code>
- getInstance() : OlcInstance
- Gets the OlcInstance that this API is associated with.
Properties
$_olcInstance
private
OlcInstance
$_olcInstance
Methods
__construct()
BaseApi constructor.
public
__construct(OlcInstance $_olcInstance) : mixed
Parameters
- $_olcInstance : OlcInstance
-
OlcInstance that this API is associated with
all()
Fetch all custom fields <code> <?php $response = $olc->customFields()->all(); ?> </code>
public
all([array<string, mixed> $params = [] ]) : array{message: string, data: array{key: string, value: string, defaultValue: string, strict: bool}}
Parameters
- $params : array<string, mixed> = []
-
Parameters to send with the request.
Tags
Return values
array{message: string, data: array{key: string, value: string, defaultValue: string, strict: bool}} —The response data.
allPaginated()
Fetch all paginated custom fields <code> <?php $response = $olc->customFields()->allPaginated([ //'page' => 1, //'perPage' => 10, ]); ?> </code>
public
allPaginated([array{page?: int, perPage?: int} $params = [] ]) : array<string|int, mixed>
Parameters
- $params : array{page?: int, perPage?: int} = []
-
Parameters to send with the request.
Tags
Return values
array<string|int, mixed> —The response data.
create()
Create a custom field <code> <?php $response = $olc->customFields()->create('Wife Name'); ?> </code>
public
create(string $name) : array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}}
Parameters
- $name : string
-
The custom field name
Tags
Return values
array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}} —The result of the request
delete()
Removes custom field by the given id <code> <?php $response = $olc->customFields()->delete(1); ?> </code>
public
delete(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The custom field id
Tags
Return values
array<string|int, mixed> —The response data.
get()
Get custom field by the given id <code> <?php $response = $olc->customFields()->get(1); ?> </code>
public
get(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The custom field id
Tags
Return values
array<string|int, mixed> —The response data.
update()
Updates a custom field <code> <?php $response = $olc->customFields()->update(1, 'Wife Name'); ?> </code>
public
update(int $id, string $name) : array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}}
Parameters
- $id : int
-
The custom field ID
- $name : string
-
The name to update
Tags
Return values
array{message: string, data: array{id: int, key: string, value: string, defaultValue: string, isLiveMode: bool, creator: null|array, createdAt: string}} —The result of the request
getInstance()
Gets the OlcInstance that this API is associated with.
protected
getInstance() : OlcInstance