W3cubDocs

/Drupal 8

public function DateFormatter::__construct

public DateFormatter::__construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, RequestStack $request_stack)

Constructs a Date object.

Parameters

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\StringTranslation\TranslationInterface $translation: The string translation.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

File

core/lib/Drupal/Core/Datetime/DateFormatter.php, line 92

Class

DateFormatter
Provides a service to handle various date related functionality.

Namespace

Drupal\Core\Datetime

Code

public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, RequestStack $request_stack) {
  $this->dateFormatStorage = $entity_manager->getStorage('date_format');
  $this->languageManager = $language_manager;
  $this->stringTranslation = $translation;
  $this->configFactory = $config_factory;
  $this->requestStack = $request_stack;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Datetime!DateFormatter.php/function/DateFormatter::__construct/8.1.x