searching
in package
Class searching
Tags
Table of Contents
Properties
Methods
- search_articles() : array<string|int, mixed>|false
- Searches articles based on a given term.
- search_customers() : array<string|int, mixed>|false
- Searches for customers using a given search term.
- getappkeys() : void
- Retrieves application keys for all active tenants.
- gettoken() : mixed
- Retrieves a token for a given tenant and app key.
- gettokens() : void
- Retrieves tokens for each app key in the appkeys array.
- send() : mixed
- Sends a request to the specified URI with the given data.
Properties
$appkeys
private
array<string|int, mixed>
$appkeys
= []
Stores the application keys.
$tokens
private
array<string|int, mixed>
$tokens
= []
Stores the tokens.
Methods
search_articles()
Searches articles based on a given term.
public
search_articles(string $term) : array<string|int, mixed>|false
Parameters
- $term : string
-
The term to search for
Return values
array<string|int, mixed>|false —Returns an array of search results if successful, otherwise false
search_customers()
Searches for customers using a given search term.
public
search_customers(string $term) : array<string|int, mixed>|false
Parameters
- $term : string
-
The search term to use for searching customers.
Return values
array<string|int, mixed>|false —An array of customers if found, otherwise false.
getappkeys()
Retrieves application keys for all active tenants.
private
getappkeys() : void
gettoken()
Retrieves a token for a given tenant and app key.
private
gettoken(string $tenant, string $appkey) : mixed
Parameters
- $tenant : string
-
The tenant name.
- $appkey : string
-
The app key.
Return values
mixed —The response from the API call.
gettokens()
Retrieves tokens for each app key in the appkeys array.
private
gettokens() : void
If tokens have already been retrieved, the method does nothing.
send()
Sends a request to the specified URI with the given data.
private
send(string $ten, string $uri[, array<string|int, mixed>|string $data = array() ]) : mixed
If the data is an array, it will be encoded as JSON.
Parameters
- $ten : string
-
The tenant name.
- $uri : string
-
The URI to send the request to.
- $data : array<string|int, mixed>|string = array()
-
The data to send with the request.
Return values
mixed —The response from the request, decoded as JSON. Returns false if there was an error with the cURL request.