You are here

class UcCountryServiceProvider in Ubercart 8.4

Substitutes the uc_country manager service for the core country_manager.

Hierarchy

Expanded class hierarchy of UcCountryServiceProvider

File

uc_country/src/UcCountryServiceProvider.php, line 12

Namespace

Drupal\uc_country
View source
class UcCountryServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    $definition = $container
      ->getDefinition('country_manager');

    // Overrides country_manager class to add additional functionality.
    $definition
      ->setClass('Drupal\\uc_country\\CountryManager');

    // Inject the entity_type.manager and string_translation services,
    // which are not available in the core country_manager.
    $definition
      ->addArgument(new Reference('entity_type.manager'));
    $definition
      ->addArgument(new Reference('string_translation'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1
UcCountryServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter