431 lines
10 KiB
PHP
431 lines
10 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
|
/**
|
|
* Scrum
|
|
*
|
|
* @ORM\Entity(repositoryClass="App\Repository\ScrumRepository")
|
|
* @ORM\Table(name="scrum", uniqueConstraints={@ORM\UniqueConstraint(name="namescrum", columns={"name"})} )
|
|
* @UniqueEntity("name", message="Ce nom de groupe existe dèja")
|
|
*/
|
|
class Scrum
|
|
{
|
|
/**
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(name="name", type="string")
|
|
*
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @ORM\Column(name="category", type="string", nullable=true)
|
|
*
|
|
*/
|
|
private $category;
|
|
|
|
/**
|
|
* @ORM\Column(name="updatedate", type="datetime", nullable=true)
|
|
*
|
|
*/
|
|
private $updatedate;
|
|
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $giteaid;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
private $giteaname;
|
|
|
|
/**
|
|
* @ORM\Column(type="json")
|
|
*/
|
|
private $giteajson;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="User", mappedBy="scrums")
|
|
*/
|
|
private $users;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumcolumn", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"rowid" = "ASC"})
|
|
*/
|
|
private $scrumcolumns;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumsprint", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"rowid" = "ASC"})
|
|
*/
|
|
private $scrumsprints;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumissue", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"giteamilestonename" = "DESC", "rowid" = "ASC"})
|
|
*/
|
|
private $scrumissues;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumteam", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"rowid" = "ASC"})
|
|
*/
|
|
private $scrumteams;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumpriority", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"rowid" = "ASC"})
|
|
*/
|
|
private $scrumprioritys;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Scrumtype", mappedBy="scrum", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"rowid" = "ASC"})
|
|
*/
|
|
private $scrumtypes;
|
|
|
|
public function getStatistique()
|
|
{
|
|
$id=-100;
|
|
$issues=$this->getScrumissues();
|
|
$tab=[];
|
|
foreach($issues as $issue) {
|
|
if($id!=$issue->getGiteamilestone()) {
|
|
$id=$issue->getGiteamilestone();
|
|
$label=($issue->getGiteamilestonename()?$issue->getGiteamilestonename():"Aucun");
|
|
$tab[$id]=["Jalon",$label,0];
|
|
}
|
|
$tab[$id][2]=$tab[$id][2]+1;
|
|
}
|
|
|
|
return $tab;
|
|
}
|
|
|
|
public function getScrumsprintstosee($viewclosed) {
|
|
$sprints=$this->getScrumsprints();
|
|
if($viewclosed=="false") {
|
|
foreach($sprints as $sprint) {
|
|
if($sprint->getClosed()) {
|
|
$sprints->removeElement($sprint);
|
|
}
|
|
}
|
|
}
|
|
return $sprints;
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
$this->users = new ArrayCollection();
|
|
$this->scumcolumns = new ArrayCollection();
|
|
$this->scrumcolumns = new ArrayCollection();
|
|
$this->scrumissues = new ArrayCollection();
|
|
$this->scrumteams = new ArrayCollection();
|
|
$this->scrumprioritys = new ArrayCollection();
|
|
$this->scrumtypes = new ArrayCollection();
|
|
$this->scrumsprints = new ArrayCollection();
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): self
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getGiteaid(): ?int
|
|
{
|
|
return $this->giteaid;
|
|
}
|
|
|
|
public function setGiteaid(int $giteaid): self
|
|
{
|
|
$this->giteaid = $giteaid;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getGiteaname(): ?string
|
|
{
|
|
return $this->giteaname;
|
|
}
|
|
|
|
public function setGiteaname(string $giteaname): self
|
|
{
|
|
$this->giteaname = $giteaname;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getGiteajson(): ?array
|
|
{
|
|
return $this->giteajson;
|
|
}
|
|
|
|
public function setGiteajson(array $giteajson): self
|
|
{
|
|
$this->giteajson = $giteajson;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|User[]
|
|
*/
|
|
public function getUsers(): Collection
|
|
{
|
|
return $this->users;
|
|
}
|
|
|
|
public function addUser(User $user): self
|
|
{
|
|
if (!$this->users->contains($user)) {
|
|
$this->users[] = $user;
|
|
$user->addScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeUser(User $user): self
|
|
{
|
|
if ($this->users->contains($user)) {
|
|
$this->users->removeElement($user);
|
|
$user->removeScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumcolumn[]
|
|
*/
|
|
public function getScrumcolumns(): Collection
|
|
{
|
|
return $this->scrumcolumns;
|
|
}
|
|
|
|
public function addScrumcolumn(Scrumcolumn $scrumcolumn): self
|
|
{
|
|
if (!$this->scrumcolumns->contains($scrumcolumn)) {
|
|
$this->scrumcolumns[] = $scrumcolumn;
|
|
$scrumcolumn->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumcolumn(Scrumcolumn $scrumcolumn): self
|
|
{
|
|
if ($this->scrumcolumns->contains($scrumcolumn)) {
|
|
$this->scrumcolumns->removeElement($scrumcolumn);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumcolumn->getScrum() === $this) {
|
|
$scrumcolumn->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumissue[]
|
|
*/
|
|
public function getScrumissues(): Collection
|
|
{
|
|
return $this->scrumissues;
|
|
}
|
|
|
|
public function addScrumissue(Scrumissue $scrumissue): self
|
|
{
|
|
if (!$this->scrumissues->contains($scrumissue)) {
|
|
$this->scrumissues[] = $scrumissue;
|
|
$scrumissue->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumissue(Scrumissue $scrumissue): self
|
|
{
|
|
if ($this->scrumissues->contains($scrumissue)) {
|
|
$this->scrumissues->removeElement($scrumissue);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumissue->getScrum() === $this) {
|
|
$scrumissue->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUpdatedate(): ?\DateTimeInterface
|
|
{
|
|
return $this->updatedate;
|
|
}
|
|
|
|
public function setUpdatedate(?\DateTimeInterface $updatedate): self
|
|
{
|
|
$this->updatedate = $updatedate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCategory(): ?string
|
|
{
|
|
return $this->category;
|
|
}
|
|
|
|
public function setCategory(?string $category): self
|
|
{
|
|
$this->category = $category;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumteam[]
|
|
*/
|
|
public function getScrumteams(): Collection
|
|
{
|
|
return $this->scrumteams;
|
|
}
|
|
|
|
public function addScrumteam(Scrumteam $scrumteam): self
|
|
{
|
|
if (!$this->scrumteams->contains($scrumteam)) {
|
|
$this->scrumteams[] = $scrumteam;
|
|
$scrumteam->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumteam(Scrumteam $scrumteam): self
|
|
{
|
|
if ($this->scrumteams->contains($scrumteam)) {
|
|
$this->scrumteams->removeElement($scrumteam);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumteam->getScrum() === $this) {
|
|
$scrumteam->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumpriority[]
|
|
*/
|
|
public function getScrumprioritys(): Collection
|
|
{
|
|
return $this->scrumprioritys;
|
|
}
|
|
|
|
public function addScrumpriority(Scrumpriority $scrumpriority): self
|
|
{
|
|
if (!$this->scrumprioritys->contains($scrumpriority)) {
|
|
$this->scrumprioritys[] = $scrumpriority;
|
|
$scrumpriority->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumpriority(Scrumpriority $scrumpriority): self
|
|
{
|
|
if ($this->scrumprioritys->contains($scrumpriority)) {
|
|
$this->scrumprioritys->removeElement($scrumpriority);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumpriority->getScrum() === $this) {
|
|
$scrumpriority->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumtype[]
|
|
*/
|
|
public function getScrumtypes(): Collection
|
|
{
|
|
return $this->scrumtypes;
|
|
}
|
|
|
|
public function addScrumtype(Scrumtype $scrumtype): self
|
|
{
|
|
if (!$this->scrumtypes->contains($scrumtype)) {
|
|
$this->scrumtypes[] = $scrumtype;
|
|
$scrumtype->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumtype(Scrumtype $scrumtype): self
|
|
{
|
|
if ($this->scrumtypes->contains($scrumtype)) {
|
|
$this->scrumtypes->removeElement($scrumtype);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumtype->getScrum() === $this) {
|
|
$scrumtype->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Scrumsprint[]
|
|
*/
|
|
public function getScrumsprints(): Collection
|
|
{
|
|
return $this->scrumsprints;
|
|
}
|
|
|
|
public function addScrumsprint(Scrumsprint $scrumsprint): self
|
|
{
|
|
if (!$this->scrumsprints->contains($scrumsprint)) {
|
|
$this->scrumsprints[] = $scrumsprint;
|
|
$scrumsprint->setScrum($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScrumsprint(Scrumsprint $scrumsprint): self
|
|
{
|
|
if ($this->scrumsprints->contains($scrumsprint)) {
|
|
$this->scrumsprints->removeElement($scrumsprint);
|
|
// set the owning side to null (unless already changed)
|
|
if ($scrumsprint->getScrum() === $this) {
|
|
$scrumsprint->setScrum(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
} |