You are here

class FarmKmlServiceProvider in farmOS 2.x

Adds kml as known format.

Hierarchy

Expanded class hierarchy of FarmKmlServiceProvider

File

modules/core/kml/src/FarmKmlServiceProvider.php, line 11

Namespace

Drupal\farm_kml
View source
class FarmKmlServiceProvider implements ServiceModifierInterface {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    if ($container
      ->has('http_middleware.negotiation') && is_a($container
      ->getDefinition('http_middleware.negotiation')
      ->getClass(), '\\Drupal\\Core\\StackMiddleware\\NegotiationMiddleware', TRUE)) {
      $container
        ->getDefinition('http_middleware.negotiation')
        ->addMethodCall('registerFormat', [
        'kml',
        [
          'application/vnd.google-earth.kml+xml',
        ],
      ]);
    }
  }

}

Members

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