Initial commit
This commit is contained in:
68
src/App/Entity/KanbanBoard.php
Normal file
68
src/App/Entity/KanbanBoard.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class KanbanBoard implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
private $kanbanEntries;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->kanbanEntries = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
public function getKanbanEntries(): ArrayCollection
|
||||
{
|
||||
return $this->kanbanEntries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry[]|ArrayCollection $kanbanEntries
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function setKanbanEntries(ArrayCollection $kanbanEntries): KanbanBoard
|
||||
{
|
||||
$this->kanbanEntries = $kanbanEntries;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $kanbanEntry
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function addKanbanEntry(KanbanEntry $kanbanEntry): KanbanBoard
|
||||
{
|
||||
if(!$this->kanbanEntries->contains($kanbanEntry)) {
|
||||
$this->kanbanEntries->add($kanbanEntry);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $kanbanEntry
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function removeKanbanEntry(KanbanEntry $kanbanEntry): KanbanBoard
|
||||
{
|
||||
if($this->kanbanEntries->contains($kanbanEntry)) {
|
||||
$this->kanbanEntries->removeElement($kanbanEntry);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function jsonSerialize()
|
||||
{
|
||||
return $this->kanbanEntries->getValues();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user