DNADesign\AudioDefinition\Services\MaoriTranslationService
Synopsis
class MaoriTranslationService
implements
TranslationService
{
- // members
- private static string $api_url = 'https://maoridictionary.co.nz/api/1.1/search/';
- private static $api_key;
- // methods
- public boolean enabled()
- public array getDefinitionAndAudio()
- private static string get_search_url()
- private static void set_info_from_api_response()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Implements
Members
private
- $api_key
- $api_url
Methods
private
- get_search_url() — Build URL to perform the search
- set_info_from_api_response() — Populate the info array with relevant data from the API
public
- enabled() — Check that we have an API key
- getDefinitionAndAudio() — Queries the service to retrieve the information related to the keywords