You are here

class BibciteMarcServiceProvider in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_marc/src/BibciteMarcServiceProvider.php \Drupal\bibcite_marc\BibciteMarcServiceProvider

Adds MARC as known format.

Hierarchy

Expanded class hierarchy of BibciteMarcServiceProvider

File

modules/bibcite_marc/src/BibciteMarcServiceProvider.php, line 11

Namespace

Drupal\bibcite_marc
View 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

Namesort descending Modifiers Type Description Overrides
BibciteMarcServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceModifierInterface::alter