You are here

public function KeyRepository::getKeysByProvider in Key 8

Get keys that use the specified key provider.

Parameters

string $key_provider_id: The key provider ID to use.

Return value

\Drupal\key\Entity\Key[] An array of key objects indexed by their ids.

Overrides KeyRepositoryInterface::getKeysByProvider

2 calls to KeyRepository::getKeysByProvider()
KeyRepository::getKeyNamesAsOptions in src/KeyRepository.php
Get an array of key names, useful as options in form fields.
KeyRepository::getKeysByStorageMethod in src/KeyRepository.php
Get keys that use the specified storage method.

File

src/KeyRepository.php, line 70

Class

KeyRepository
Provides a repository for Key configuration entities.

Namespace

Drupal\key

Code

public function getKeysByProvider($key_provider_id) {
  return $this->entityTypeManager
    ->getStorage('key')
    ->loadByProperties([
    'key_provider' => $key_provider_id,
  ]);
}