public function ProviderRepository::get in Drupal 9
Same name in this branch
- 9 core/modules/media/src/OEmbed/ProviderRepository.php \Drupal\media\OEmbed\ProviderRepository::get()
- 9 core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php \Drupal\media_test_oembed\ProviderRepository::get()
Same name and namespace in other branches
- 8 core/modules/media/src/OEmbed/ProviderRepository.php \Drupal\media\OEmbed\ProviderRepository::get()
Returns information for a specific oEmbed provider.
Parameters
string $provider_name: The name of the provider.
Return value
\Drupal\media\OEmbed\Provider A value object containing information about the provider.
Throws
\InvalidArgumentException If there is no known oEmbed provider with the specified name.
Overrides ProviderRepositoryInterface::get
1 call to ProviderRepository::get()
- ProviderRepository::get in core/
modules/ media/ tests/ modules/ media_test_oembed/ src/ ProviderRepository.php - Returns information for a specific oEmbed provider.
1 method overrides ProviderRepository::get()
- ProviderRepository::get in core/
modules/ media/ tests/ modules/ media_test_oembed/ src/ ProviderRepository.php - Returns information for a specific oEmbed provider.
File
- core/
modules/ media/ src/ OEmbed/ ProviderRepository.php, line 177
Class
- ProviderRepository
- Retrieves and caches information about oEmbed providers.
Namespace
Drupal\media\OEmbedCode
public function get($provider_name) {
$providers = $this
->getAll();
if (!isset($providers[$provider_name])) {
throw new \InvalidArgumentException("Unknown provider '{$provider_name}'");
}
return $providers[$provider_name];
}