You are here

public function DateRecurNonRecurringHelper::__construct in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::__construct()
  2. 3.0.x src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::__construct()
  3. 3.1.x src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::__construct()

Constructor for DateRecurNonRecurringHelper.

Parameters

\DateTimeInterface $dtStart: The initial occurrence start date.

\DateTimeInterface|null $dtStartEnd: The initial occurrence end date, or NULL to use start date.

File

src/DateRecurNonRecurringHelper.php, line 27

Class

DateRecurNonRecurringHelper
Dummy helper for handling non-recurring values.

Namespace

Drupal\date_recur

Code

public function __construct(\DateTimeInterface $dtStart, \DateTimeInterface $dtStartEnd = NULL) {
  $dtStartEnd = $dtStartEnd ?? clone $dtStart;
  $this->occurrences = [
    new DateRange($dtStart, $dtStartEnd),
  ];
}