BibciteMarcServiceProvider.php in Bibliography & Citation 8
Same filename and directory in other branches
Namespace
Drupal\bibcite_marcFile
modules/bibcite_marc/src/BibciteMarcServiceProvider.phpView source
<?php
namespace Drupal\bibcite_marc;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
/**
* Adds MARC as known format.
*/
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',
],
]);
}
}
}
}
Classes
Name | Description |
---|---|
BibciteMarcServiceProvider | Adds MARC as known format. |