function DateFormatDeleteForm::__construct

Same name and namespace in other branches
  1. 11.x core/modules/system/src/Form/DateFormatDeleteForm.php \Drupal\system\Form\DateFormatDeleteForm::__construct()
  2. 9 core/modules/system/src/Form/DateFormatDeleteForm.php \Drupal\system\Form\DateFormatDeleteForm::__construct()
  3. 8.9.x core/modules/system/src/Form/DateFormatDeleteForm.php \Drupal\system\Form\DateFormatDeleteForm::__construct()
  4. main core/modules/system/src/Form/DateFormatDeleteForm.php \Drupal\system\Form\DateFormatDeleteForm::__construct()

Constructs a DateFormatDeleteForm object.

Parameters

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter service.

\Drupal\Component\Datetime\TimeInterface|null $time: The time service.

File

core/modules/system/src/Form/DateFormatDeleteForm.php, line 32

Class

DateFormatDeleteForm
Builds a form to delete a date format.

Namespace

Drupal\system\Form

Code

public function __construct(DateFormatterInterface $date_formatter, protected ?TimeInterface $time = NULL) {
  $this->dateFormatter = $date_formatter;
  if ($this->time === NULL) {
    @trigger_error('Calling ' . __METHOD__ . ' without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3112298', E_USER_DEPRECATED);
    $this->time = \Drupal::service('datetime.time');
  }
}

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