class RegisterOEmbedProviderClassesCompilerPass in oEmbed 8
Hierarchy
- class \Drupal\oembed\RegisterOEmbedProviderClassesCompilerPass implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
Expanded class hierarchy of RegisterOEmbedProviderClassesCompilerPass
File
- src/
RegisterOEmbedProviderClassesCompilerPass.php, line 9
Namespace
Drupal\oembedView source
class RegisterOEmbedProviderClassesCompilerPass implements CompilerPassInterface {
/**
* @var string Service ID of the provider resolver
*/
private $providerResolverService;
/**
* @var string Tag name for providers.
*/
private $providerTag;
/**
* Constructor.
*
* @param string $providerResolverService Service name of the provider resolver in processed container
* @param string $providerTag Tag name used for provider
*/
public function __construct($providerResolverService = 'oembed.provider_resolver', $providerTag = 'oembed.provider') {
$this->providerResolverService = $providerResolverService;
$this->providerTag = $providerTag;
}
/**
* You can modify the container here before it is dumped to PHP code.
*
* @param ContainerBuilder $container
*/
public function process(ContainerBuilder $container) {
if (!$container
->hasDefinition($this->providerResolverService) && !$container
->hasAlias($this->providerResolverService)) {
return;
}
$definition = $container
->findDefinition($this->providerResolverService);
foreach ($container
->findTaggedServiceIds($this->providerTag) as $id => $providers) {
$definition
->addMethodCall('addProvider', array(
new Reference($id),
));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegisterOEmbedProviderClassesCompilerPass:: |
private | property | ||
RegisterOEmbedProviderClassesCompilerPass:: |
private | property | ||
RegisterOEmbedProviderClassesCompilerPass:: |
public | function | You can modify the container here before it is dumped to PHP code. | |
RegisterOEmbedProviderClassesCompilerPass:: |
public | function | Constructor. |