class UcCountryServiceProvider in Ubercart 8.4
Substitutes the uc_country manager service for the core country_manager.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\uc_country\UcCountryServiceProvider
Expanded class hierarchy of UcCountryServiceProvider
File
- uc_country/
src/ UcCountryServiceProvider.php, line 12
Namespace
Drupal\uc_countryView 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
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |
UcCountryServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |