final class Loqate in Loqate 8
Same name and namespace in other branches
- 2.x src/Loqate.php \Drupal\loqate\Loqate
Class Loqate.
@package Drupal\loqate
Hierarchy
- class \Drupal\loqate\Loqate
Expanded class hierarchy of Loqate
1 file declares its use of Loqate
- WebformAddressLoqate.php in modules/
pca_webform/ src/ Element/ WebformAddressLoqate.php
1 string reference to 'Loqate'
File
- src/
Loqate.php, line 12
Namespace
Drupal\loqateView source
final class Loqate {
/**
* Gets the Loqate API key value.
*
* @param null $key_id
* Optional custom key module key id.
*
* @return string|null
* The key value if found or NULL.
*/
public static function getApiKey($key_id = NULL) {
if ($key_id === NULL) {
$key_id = \Drupal::config('loqate.loqateapikeyconfig')
->get(LoqateApiKeyConfigForm::DEFAULT_API_KEY);
}
if ($key_id) {
/** @var \Drupal\key\KeyRepositoryInterface $key_repository */
$key_repository = \Drupal::service('key.repository');
$key_entity = $key_repository
->getKey($key_id);
if ($key_entity) {
return $key_entity
->getKeyValue();
}
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Loqate:: |
public static | function | Gets the Loqate API key value. |