interface LabelSourceAdapterContract

A label source adapter.

Methods

array
find(Request$request)

Find a label in the label source.

array
create(int$id,Request$request)

Create the label (or labels) from the label source based on an API request.

Details

at line19
array find(Request$request)

Find a label in the label source.

Parameters

Request $request

Return Value

array All labels of the label source that match the query

at line40
array create(int$id,Request$request)

Create the label (or labels) from the label source based on an API request.

The request may contain arbitrary input data. This function may create multiple labels (e.g. all parent labels of the label to create) as well.

Parameters

int $id Label tree ID
Request $request

Return Value

array Array of Label objects that were created

Exceptions

ValidationException If any of the request parameters are wrong. Example:

throw new ValidationException(null, [
   'my_field' => ['My field contains invalid data.']
]);