public function DateRange::setStart in Recurring Dates Field 3.1.x
Same name and namespace in other branches
- 8.2 src/DateRange.php \Drupal\date_recur\DateRange::setStart()
- 3.x src/DateRange.php \Drupal\date_recur\DateRange::setStart()
- 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_recurCode
public function setStart(\DateTimeInterface $start) {
// Clone to ensure references are lost.
$this->start = clone $start;
$this
->validateDates();
return $this;
}