You are here

public function DateRange::setStart in Recurring Dates Field 3.1.x

Same name and namespace in other branches
  1. 8.2 src/DateRange.php \Drupal\date_recur\DateRange::setStart()
  2. 3.x src/DateRange.php \Drupal\date_recur\DateRange::setStart()
  3. 3.0.x src/DateRange.php \Drupal\date_recur\DateRange::setStart()

Set the start date.

Parameters

\DateTimeInterface $start: The start date.

Return value

$this Return object for chaining.

Throws

\InvalidArgumentException When there is a problem with the start and/or end date.

File

src/DateRange.php, line 62

Class

DateRange
Defines a date range.

Namespace

Drupal\date_recur

Code

public function setStart(\DateTimeInterface $start) {

  // Clone to ensure references are lost.
  $this->start = clone $start;
  $this
    ->validateDates();
  return $this;
}