function DateTimeNormalizer::__construct

Same name in other branches
  1. 8.9.x core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::__construct()
  2. 10 core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::__construct()
  3. 11.x core/modules/serialization/src/Normalizer/DateTimeNormalizer.php \Drupal\serialization\Normalizer\DateTimeNormalizer::__construct()

Constructs a new DateTimeNormalizer instance.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

File

core/modules/serialization/src/Normalizer/DateTimeNormalizer.php, line 50

Class

DateTimeNormalizer
Converts values for datetime objects to RFC3339 and from common formats.

Namespace

Drupal\serialization\Normalizer

Code

public function __construct(ConfigFactoryInterface $config_factory) {
    $this->systemDateConfig = $config_factory->get('system.date');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.