You are here

public function KeyRepository::getKey in Key 8

Get a specific key.

Parameters

string $key_id: The key ID to use.

Return value

\Drupal\key\Entity\Key The key object with the given id.

Overrides KeyRepositoryInterface::getKey

File

src/KeyRepository.php, line 114

Class

KeyRepository
Provides a repository for Key configuration entities.

Namespace

Drupal\key

Code

public function getKey($key_id) {
  return $this->entityTypeManager
    ->getStorage('key')
    ->load($key_id);
}