* tsp-info endpoint added
* different collector services are now implemented
This commit is contained in:
94
src/App/Entity/VacationDay.php
Normal file
94
src/App/Entity/VacationDay.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class VacationDay implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $day;
|
||||
|
||||
/**
|
||||
* @var string[]|ArrayCollection
|
||||
*/
|
||||
private $signums;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->signums = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDay(): int
|
||||
{
|
||||
return $this->day;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $day
|
||||
* @return VacationDay
|
||||
*/
|
||||
public function setDay(int $day): VacationDay
|
||||
{
|
||||
$this->day = $day;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ArrayCollection|string[]
|
||||
*/
|
||||
public function getSignums()
|
||||
{
|
||||
return $this->signums;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ArrayCollection|string[] $signums
|
||||
* @return VacationDay
|
||||
*/
|
||||
public function setSignums($signums): VacationDay
|
||||
{
|
||||
$this->signums = $signums;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $signum
|
||||
* @return VacationDay
|
||||
*/
|
||||
public function addSignum(string $signum): VacationDay
|
||||
{
|
||||
if(!$this->signums->contains($signum)) {
|
||||
$this->signums->add($signum);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $signum
|
||||
* @return VacationDay
|
||||
*/
|
||||
public function removeSignum(string $signum): VacationDay
|
||||
{
|
||||
if($this->signums->contains($signum)) {
|
||||
$this->signums->removeElement($signum);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'day' => $this->getDay(),
|
||||
'signums' => $this->getSignums()->getValues(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user