class BibciteMarcServiceProvider in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_marc/src/BibciteMarcServiceProvider.php \Drupal\bibcite_marc\BibciteMarcServiceProvider
Adds MARC as known format.
Hierarchy
- class \Drupal\bibcite_marc\BibciteMarcServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of BibciteMarcServiceProvider
File
- modules/
bibcite_marc/ src/ BibciteMarcServiceProvider.php, line 11
Namespace
Drupal\bibcite_marcView source
class BibciteMarcServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->has('http_middleware.negotiation')) {
$definition = $container
->getDefinition('http_middleware.negotiation');
if (is_a($definition
->getClass(), '\\Drupal\\Core\\StackMiddleware\\NegotiationMiddleware', TRUE)) {
$definition
->addMethodCall('registerFormat', [
'marc',
[
'application/marc',
],
]);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BibciteMarcServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |