class BibciteEndnoteServiceProvider in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_endnote/src/BibciteEndnoteServiceProvider.php \Drupal\bibcite_endnote\BibciteEndnoteServiceProvider
Adds EndNote as known format.
Hierarchy
- class \Drupal\bibcite_endnote\BibciteEndnoteServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of BibciteEndnoteServiceProvider
File
- modules/
bibcite_endnote/ src/ BibciteEndnoteServiceProvider.php, line 11
Namespace
Drupal\bibcite_endnoteView source
class BibciteEndnoteServiceProvider 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', [
'endnote7',
[
'text/xml',
'application/x-endnote-refer',
],
]);
$definition
->addMethodCall('registerFormat', [
'endnote8',
[
'text/xml',
'application/x-endnote-refer',
],
]);
$definition
->addMethodCall('registerFormat', [
'tagged',
[
'text/plain',
'application/x-endnote-refer',
],
]);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BibciteEndnoteServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |