2017-07-31 15:50:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
|
|
|
|
|
class KanbanBoard implements \JsonSerializable
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
2017-08-02 18:49:50 +02:00
|
|
|
private $inbox;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
private $inProgress;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
private $verification;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
private $done;
|
2017-07-31 15:50:48 +02:00
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
$this->inbox = new ArrayCollection();
|
|
|
|
|
$this->inProgress = new ArrayCollection();
|
|
|
|
|
$this->verification = new ArrayCollection();
|
|
|
|
|
$this->done = new ArrayCollection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
public function getInbox(): ArrayCollection
|
|
|
|
|
{
|
|
|
|
|
return $this->inbox;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry[]|ArrayCollection $inbox
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function setInbox(ArrayCollection $inbox): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
$this->inbox = $inbox;
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $inbox
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function addInbox(KanbanEntry $inbox): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if (!$this->inbox->contains($inbox)) {
|
|
|
|
|
$this->inbox->add($inbox);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $inbox
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function removeInbox(KanbanEntry $inbox): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if ($this->inbox->contains($inbox)) {
|
|
|
|
|
$this->inbox->removeElement($inbox);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
public function getInProgress(): ArrayCollection
|
|
|
|
|
{
|
|
|
|
|
return $this->inProgress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry[]|ArrayCollection $inProgress
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function setInProgress(ArrayCollection $inProgress): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
$this->inProgress = $inProgress;
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $inProgress
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function addInProgress(KanbanEntry $inProgress): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if (!$this->inProgress->contains($inProgress)) {
|
|
|
|
|
$this->inProgress->add($inProgress);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $inProgress
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function removeInProgress(KanbanEntry $inProgress): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if ($this->inProgress->contains($inProgress)) {
|
|
|
|
|
$this->inProgress->removeElement($inProgress);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
|
|
|
|
public function getVerification(): ArrayCollection
|
|
|
|
|
{
|
|
|
|
|
return $this->verification;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry[]|ArrayCollection $verification
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function setVerification(ArrayCollection $verification): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
$this->verification = $verification;
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $verification
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function addVerification(KanbanEntry $verification): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if (!$this->verification->contains($verification)) {
|
|
|
|
|
$this->verification->add($verification);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param KanbanEntry $verification
|
|
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
|
|
|
|
public function removeVerification(KanbanEntry $verification): KanbanBoard
|
|
|
|
|
{
|
|
|
|
|
if ($this->verification->contains($verification)) {
|
|
|
|
|
$this->verification->removeElement($verification);
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
2017-07-31 15:50:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return KanbanEntry[]|ArrayCollection
|
|
|
|
|
*/
|
2017-08-02 18:49:50 +02:00
|
|
|
public function getDone(): ArrayCollection
|
2017-07-31 15:50:48 +02:00
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
return $this->done;
|
2017-07-31 15:50:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-08-02 18:49:50 +02:00
|
|
|
* @param KanbanEntry[]|ArrayCollection $verification
|
2017-07-31 15:50:48 +02:00
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
2017-08-02 18:49:50 +02:00
|
|
|
public function setDone(ArrayCollection $verification): KanbanBoard
|
2017-07-31 15:50:48 +02:00
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
$this->done = $verification;
|
2017-07-31 15:50:48 +02:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-08-02 18:49:50 +02:00
|
|
|
* @param KanbanEntry $verification
|
2017-07-31 15:50:48 +02:00
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
2017-08-02 18:49:50 +02:00
|
|
|
public function addDone(KanbanEntry $verification): KanbanBoard
|
2017-07-31 15:50:48 +02:00
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
if (!$this->done->contains($verification)) {
|
|
|
|
|
$this->done->add($verification);
|
2017-07-31 15:50:48 +02:00
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-08-02 18:49:50 +02:00
|
|
|
* @param KanbanEntry $verification
|
2017-07-31 15:50:48 +02:00
|
|
|
* @return KanbanBoard
|
|
|
|
|
*/
|
2017-08-02 18:49:50 +02:00
|
|
|
public function removeDone(KanbanEntry $verification): KanbanBoard
|
2017-07-31 15:50:48 +02:00
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
if ($this->done->contains($verification)) {
|
|
|
|
|
$this->done->removeElement($verification);
|
2017-07-31 15:50:48 +02:00
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
function jsonSerialize()
|
|
|
|
|
{
|
2017-08-02 18:49:50 +02:00
|
|
|
return [
|
|
|
|
|
'inbox' => $this->inbox->getValues(),
|
|
|
|
|
'inProgress' => $this->inProgress->getValues(),
|
|
|
|
|
'verification' => $this->verification->getValues(),
|
|
|
|
|
'done' => $this->done->getValues(),
|
|
|
|
|
];
|
2017-07-31 15:50:48 +02:00
|
|
|
}
|
|
|
|
|
}
|