Initial Version
This commit is contained in:
65
shared/lib/Resource/Range/RangeDate.php
Normal file
65
shared/lib/Resource/Range/RangeDate.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Resource\Range;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
|
||||
class RangeDate extends Range implements IRangeDate {
|
||||
|
||||
protected DateTimeInterface $start;
|
||||
protected DateTimeInterface $end;
|
||||
|
||||
/**
|
||||
* Returns the type of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function type(): RangeType {
|
||||
return RangeType::DATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start date of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getStart(): DateTimeInterface {
|
||||
return $this->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start date of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setStart(DateTimeInterface $value): void {
|
||||
$this->start = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end date of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getEnd(): DateTimeInterface {
|
||||
return $this->end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the end date of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setEnd(DateTimeInterface $value): void {
|
||||
$this->end = $value;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user