class SearchHelper (View source)

Helper class for Search parameter building for Rokka.io service.

Methods

static bool
validateFieldName(string $fieldName)

Validates the field name.

static string
buildSearchSortParameter(array $sorts)

Builds the "sort" parameter for the source image listing API endpoint.

Details

static bool validateFieldName(string $fieldName)

Validates the field name.

Parameters

string $fieldName

Return Value

bool

Returns true if the field name is valid, false otherwise

static string buildSearchSortParameter(array $sorts)

Builds the "sort" parameter for the source image listing API endpoint.

The sort direction can either be: "asc", "desc" (or the boolean TRUE value, treated as "asc")

Parameters

array $sorts

The sorting options, as an associative array "field => sort-direction"

Return Value

string