function ProviderRepository::get

Same name in this branch
  1. 11.x core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php \Drupal\media_test_oembed\ProviderRepository::get()
Same name in other branches
  1. 9 core/modules/media/src/OEmbed/ProviderRepository.php \Drupal\media\OEmbed\ProviderRepository::get()
  2. 9 core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php \Drupal\media_test_oembed\ProviderRepository::get()
  3. 8.9.x core/modules/media/src/OEmbed/ProviderRepository.php \Drupal\media\OEmbed\ProviderRepository::get()
  4. 8.9.x core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php \Drupal\media_test_oembed\ProviderRepository::get()
  5. 10 core/modules/media/src/OEmbed/ProviderRepository.php \Drupal\media\OEmbed\ProviderRepository::get()
  6. 10 core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php \Drupal\media_test_oembed\ProviderRepository::get()
1 call to ProviderRepository::get()
ProviderRepository::get in core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php
1 method overrides ProviderRepository::get()
ProviderRepository::get in core/modules/media/tests/modules/media_test_oembed/src/ProviderRepository.php

File

core/modules/media/src/OEmbed/ProviderRepository.php, line 152

Class

ProviderRepository
Retrieves and caches information about oEmbed providers.

Namespace

Drupal\media\OEmbed

Code

public function get($provider_name) {
    $providers = $this->getAll();
    if (!isset($providers[$provider_name])) {
        throw new \InvalidArgumentException("Unknown provider '{$provider_name}'");
    }
    return $providers[$provider_name];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.