mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-09 21:37:33 +03:00
44 lines
805 B
PHP
44 lines
805 B
PHP
<?php
|
|
namespace Shlinkio\Shlink\Common\Util;
|
|
|
|
class DateRange
|
|
{
|
|
/**
|
|
* @var \DateTimeInterface
|
|
*/
|
|
private $startDate;
|
|
/**
|
|
* @var \DateTimeInterface
|
|
*/
|
|
private $endDate;
|
|
|
|
public function __construct(\DateTimeInterface $startDate = null, \DateTimeInterface $endDate = null)
|
|
{
|
|
$this->startDate = $startDate;
|
|
$this->endDate = $endDate;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTimeInterface
|
|
*/
|
|
public function getStartDate()
|
|
{
|
|
return $this->startDate;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTimeInterface
|
|
*/
|
|
public function getEndDate()
|
|
{
|
|
return $this->endDate;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isEmpty()
|
|
{
|
|
return is_null($this->startDate) && is_null($this->endDate);
|
|
}
|
|
}
|