public function ProviderRepositoryDecorator::__construct in oEmbed Providers 2.x
Same name and namespace in other branches
- 1.0.x src/OEmbed/ProviderRepositoryDecorator.php \Drupal\oembed_providers\OEmbed\ProviderRepositoryDecorator::__construct()
- 1.1.x src/OEmbed/ProviderRepositoryDecorator.php \Drupal\oembed_providers\OEmbed\ProviderRepositoryDecorator::__construct()
Constructs a ProviderRepository instance.
Parameters
\Drupal\media\OEmbed\ProviderRepositoryInterface $decorated: Retrieves and caches information about oEmbed providers.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Manages entity type plugin definitions.
\GuzzleHttp\ClientInterface $http_client: The HTTP client.
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.
\Drupal\Component\Datetime\TimeInterface $time: The time service.
\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory: The key-value store factory.
\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: The logger channel factory.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.
int $max_age: (optional) How long the cache data should be kept. Defaults to a week.
File
- src/
OEmbed/ ProviderRepositoryDecorator.php, line 116
Class
- ProviderRepositoryDecorator
- Decorates the oEmbed ProviderRepository provided by core Media module.
Namespace
Drupal\oembed_providers\OEmbedCode
public function __construct(ProviderRepositoryInterface $decorated, EntityTypeManagerInterface $entity_type_manager, ClientInterface $http_client, ConfigFactoryInterface $config_factory, TimeInterface $time, KeyValueFactoryInterface $key_value_factory = NULL, LoggerChannelFactoryInterface $logger_factory = NULL, ModuleHandlerInterface $module_handler, $max_age = 604800) {
$this->decorated = $decorated;
$this->oembedProviderStorage = $entity_type_manager
->getStorage('oembed_provider');
$this->httpClient = $http_client;
$this->providersUrl = $config_factory
->get('media.settings')
->get('oembed_providers_url');
$this->externalFetch = $config_factory
->get('oembed_providers.settings')
->get('external_fetch');
$this->time = $time;
$this->keyValue = $key_value_factory
->get('media');
$this->logger = $logger_factory
->get('media');
$this->moduleHandler = $module_handler;
$this->maxAge = (int) $max_age;
}