class InvalidIntervalException in Interval Field 8
Defines an exception for handling invalid intervals.
Hierarchy
- class \Drupal\interval\InvalidIntervalException extends \Drupal\interval\InvalidArgumentException
Expanded class hierarchy of InvalidIntervalException
1 file declares its use of InvalidIntervalException
- IntervalItem.php in src/
Plugin/ Field/ FieldType/ IntervalItem.php
File
- src/
InvalidIntervalException.php, line 8
Namespace
Drupal\intervalView source
class InvalidIntervalException extends \InvalidArgumentException {
/**
* The date time that caused the exception.
*
* @var \DateTime
*/
protected $date;
/**
* The item that caused the exception.
*
* @var \Drupal\interval\IntervalItemInterface
*/
protected $item;
/**
* Constructs a new \Drupal\interval\InvalidIntervalException.
*
* @param string $message
* Error message.
* @param int $code
* Error code.
* @param \Exception $previous
* The previous exception
* @param \DateTime $date
* The date that caused the exception.
* @param \Drupal\interval\IntervalItemInterface $item
* The item that caused the exception.
*/
public function __construct($message = "", $code = 0, \Exception $previous = NULL, \DateTime $date = NULL, IntervalItemInterface $item = NULL) {
$this->item = $item;
$this->date = $date;
parent::__construct($message, $code, $previous);
}
/**
* Get the date that caused the exception.
*
* @return \DateTime
* The date time that caused the exception.
*/
public function getDateTime() {
return $this->date;
}
/**
* Get the item that caused the exception.
*
* @return \Drupal\interval\IntervalItemInterface
* The item that caused the exception.
*/
public function getItem() {
return $this->item;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InvalidIntervalException:: |
protected | property | The date time that caused the exception. | |
InvalidIntervalException:: |
protected | property | The item that caused the exception. | |
InvalidIntervalException:: |
public | function | Get the date that caused the exception. | |
InvalidIntervalException:: |
public | function | Get the item that caused the exception. | |
InvalidIntervalException:: |
public | function | Constructs a new \Drupal\interval\InvalidIntervalException. |