class SmartDateServiceProvider in Smart Date 3.1.x
Same name and namespace in other branches
- 3.0.x src/SmartDateServiceProvider.php \Drupal\smart_date\SmartDateServiceProvider
- 3.2.x src/SmartDateServiceProvider.php \Drupal\smart_date\SmartDateServiceProvider
- 3.3.x src/SmartDateServiceProvider.php \Drupal\smart_date\SmartDateServiceProvider
- 3.4.x src/SmartDateServiceProvider.php \Drupal\smart_date\SmartDateServiceProvider
Service Provider for Smart Date.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\smart_date\SmartDateServiceProvider
Expanded class hierarchy of SmartDateServiceProvider
File
- src/
SmartDateServiceProvider.php, line 13
Namespace
Drupal\smart_dateView source
class SmartDateServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
$modules = $container
->getParameter('container.modules');
if (isset($modules['hal'])) {
// HAL module is enabled, add our Smart Date normalizer.
// Priority of the normalizer must be higher than other
// general-purpose typed data and field item normalizers.
$smart_date = new Definition(SmartDateNormalizer::class);
$smart_date
->addTag('normalizer', [
'priority' => 30,
]);
$container
->setDefinition('smart_date.normalizer.smartdate.hal', $smart_date);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |
SmartDateServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |