* tsp-info endpoint added
* different collector services are now implemented
This commit is contained in:
@@ -234,6 +234,9 @@ class KanbanBoard implements \JsonSerializable
|
||||
*/
|
||||
private function updatedAtReverseSort(array $toSort): array
|
||||
{
|
||||
$toSort = array_filter($toSort, function(KanbanEntry $item){
|
||||
return $item->getAssignee() != null;
|
||||
});
|
||||
usort($toSort, function(KanbanEntry $a, KanbanEntry $b){
|
||||
return $b->getUpdatedAt() <=> $a->getUpdatedAt();
|
||||
});
|
||||
|
||||
114
src/App/Entity/TrProgress.php
Normal file
114
src/App/Entity/TrProgress.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
class TrProgress implements \JsonSerializable
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $eriref;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $heading;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $prio;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $lastProgress;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEriref(): string
|
||||
{
|
||||
return $this->eriref;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $eriref
|
||||
* @return TrProgress
|
||||
*/
|
||||
public function setEriref(string $eriref): TrProgress
|
||||
{
|
||||
$this->eriref = $eriref;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeading(): string
|
||||
{
|
||||
return $this->heading;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $heading
|
||||
* @return TrProgress
|
||||
*/
|
||||
public function setHeading(string $heading): TrProgress
|
||||
{
|
||||
$this->heading = $heading;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPrio(): string
|
||||
{
|
||||
return $this->prio;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prio
|
||||
* @return TrProgress
|
||||
*/
|
||||
public function setPrio(string $prio): TrProgress
|
||||
{
|
||||
$this->prio = $prio;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLastProgress(): int
|
||||
{
|
||||
return $this->lastProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $lastProgress
|
||||
* @return TrProgress
|
||||
*/
|
||||
public function setLastProgress(int $lastProgress): TrProgress
|
||||
{
|
||||
$this->lastProgress = $lastProgress;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'eriref' => $this->getEriref(),
|
||||
'heading' => $this->getHeading(),
|
||||
'prio' => $this->getPrio(),
|
||||
'lastProgress' => $this->getLastProgress(),
|
||||
];
|
||||
}
|
||||
}
|
||||
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