You are here

class BibciteRisServiceProvider in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_ris/src/BibciteRisServiceProvider.php \Drupal\bibcite_ris\BibciteRisServiceProvider

Adds RIS as known format.

Hierarchy

Expanded class hierarchy of BibciteRisServiceProvider

File

modules/bibcite_ris/src/BibciteRisServiceProvider.php, line 11

Namespace

Drupal\bibcite_ris
View source
class BibciteRisServiceProvider 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', [
          'ris',
          [
            'text/plain',
            'application/x-research-info-systems',
          ],
        ]);
      }
    }
  }

}

Members

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