dockerisation
This commit is contained in:
0
src/Entity/.gitignore
vendored
Normal file
0
src/Entity/.gitignore
vendored
Normal file
219
src/Entity/Config.php
Normal file
219
src/Entity/Config.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
*
|
||||
* @ORM\Table(name="config")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ConfigRepository")
|
||||
*/
|
||||
class Config
|
||||
{ /**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="defaultvalue", type="text")
|
||||
*/
|
||||
protected $default;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="string")
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $visible;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $changeable;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $required;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $grouped;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $category;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
protected $help;
|
||||
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(string $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getValue(): ?string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue(string $value): self
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrder(): ?string
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(string $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVisible(): ?bool
|
||||
{
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
public function setVisible(bool $visible): self
|
||||
{
|
||||
$this->visible = $visible;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getChangeable(): ?bool
|
||||
{
|
||||
return $this->changeable;
|
||||
}
|
||||
|
||||
public function setChangeable(bool $changeable): self
|
||||
{
|
||||
$this->changeable = $changeable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRequired(): ?bool
|
||||
{
|
||||
return $this->required;
|
||||
}
|
||||
|
||||
public function setRequired(bool $required): self
|
||||
{
|
||||
$this->required = $required;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(string $type): self
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGrouped(): ?string
|
||||
{
|
||||
return $this->grouped;
|
||||
}
|
||||
|
||||
public function setGrouped(string $grouped): self
|
||||
{
|
||||
$this->grouped = $grouped;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCategory(): ?string
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function setCategory(string $category): self
|
||||
{
|
||||
$this->category = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHelp(): ?string
|
||||
{
|
||||
return $this->help;
|
||||
}
|
||||
|
||||
public function setHelp(string $help): self
|
||||
{
|
||||
$this->help = $help;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): self
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDefault(): ?string
|
||||
{
|
||||
return $this->default;
|
||||
}
|
||||
|
||||
public function setDefault(string $default): self
|
||||
{
|
||||
$this->default = $default;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
384
src/Entity/Cron.php
Normal file
384
src/Entity/Cron.php
Normal file
@ -0,0 +1,384 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
*
|
||||
* @ORM\Table(name="cron")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CronRepository")
|
||||
*/
|
||||
class Cron
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="command", type="string", nullable=false)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
*/
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $statut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=false)
|
||||
*/
|
||||
private $submitdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $startexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $endexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $nextexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatcall;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatexec;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatinterval;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $jsonargument;
|
||||
|
||||
private $statutlabel;
|
||||
|
||||
// A garder pour forcer l'id en init
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// A garder pour récupérer le label du statut
|
||||
public function getStatutlabel()
|
||||
{
|
||||
switch($this->statut) {
|
||||
case 0: $this->statutlabel="A éxécuter"; break;
|
||||
case 1: $this->statutlabel="Exécution en cours"; break;
|
||||
case 2: $this->statutlabel="OK"; break;
|
||||
case 3: $this->statutlabel="KO"; break;
|
||||
}
|
||||
return $this->statutlabel;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->submitdate = new \DateTime();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set command
|
||||
*
|
||||
* @param string $command
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setCommand($command)
|
||||
{
|
||||
$this->command = $command;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get command
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCommand()
|
||||
{
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set statut
|
||||
*
|
||||
* @param integer $statut
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setStatut($statut)
|
||||
{
|
||||
$this->statut = $statut;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get statut
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getStatut()
|
||||
{
|
||||
return $this->statut;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set submitdate
|
||||
*
|
||||
* @param \DateTime $submitdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setSubmitdate($submitdate)
|
||||
{
|
||||
$this->submitdate = $submitdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get submitdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getSubmitdate()
|
||||
{
|
||||
return $this->submitdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set startexecdate
|
||||
*
|
||||
* @param \DateTime $startexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setStartexecdate($startexecdate)
|
||||
{
|
||||
$this->startexecdate = $startexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get startexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getStartexecdate()
|
||||
{
|
||||
return $this->startexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set endexecdate
|
||||
*
|
||||
* @param \DateTime $endexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setEndexecdate($endexecdate)
|
||||
{
|
||||
$this->endexecdate = $endexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getEndexecdate()
|
||||
{
|
||||
return $this->endexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set nextexecdate
|
||||
*
|
||||
* @param \DateTime $nextexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setNextexecdate($nextexecdate)
|
||||
{
|
||||
$this->nextexecdate = $nextexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nextexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getNextexecdate()
|
||||
{
|
||||
return $this->nextexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatcall
|
||||
*
|
||||
* @param integer $repeatcall
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatcall($repeatcall)
|
||||
{
|
||||
$this->repeatcall = $repeatcall;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatcall
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatcall()
|
||||
{
|
||||
return $this->repeatcall;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatexec
|
||||
*
|
||||
* @param integer $repeatexec
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatexec($repeatexec)
|
||||
{
|
||||
$this->repeatexec = $repeatexec;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatexec
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatexec()
|
||||
{
|
||||
return $this->repeatexec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatinterval
|
||||
*
|
||||
* @param integer $repeatinterval
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatinterval($repeatinterval)
|
||||
{
|
||||
$this->repeatinterval = $repeatinterval;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatinterval
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatinterval()
|
||||
{
|
||||
return $this->repeatinterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set jsonargument
|
||||
*
|
||||
* @param string $jsonargument
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setJsonargument($jsonargument)
|
||||
{
|
||||
$this->jsonargument = $jsonargument;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get jsonargument
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getJsonargument()
|
||||
{
|
||||
return $this->jsonargument;
|
||||
}
|
||||
}
|
122
src/Entity/Group.php
Normal file
122
src/Entity/Group.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* Group
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GroupRepository")
|
||||
* @ORM\Table(name="groupe", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"})}, indexes={@ORM\Index(name="idexternal", columns={"idexternal"})} )
|
||||
* @UniqueEntity("name", message="Ce nom de groupe existe dèja")
|
||||
*/
|
||||
class Group
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $ldapfilter;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
*/
|
||||
private $idexternal;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="User", mappedBy="groups")
|
||||
*/
|
||||
protected $users;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->users = 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 getLdapfilter(): ?string
|
||||
{
|
||||
return $this->ldapfilter;
|
||||
}
|
||||
|
||||
public function setLdapfilter(?string $ldapfilter): self
|
||||
{
|
||||
$this->ldapfilter = $ldapfilter;
|
||||
|
||||
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->addGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUser(User $user): self
|
||||
{
|
||||
if ($this->users->contains($user)) {
|
||||
$this->users->removeElement($user);
|
||||
$user->removeGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIdexternal(): ?string
|
||||
{
|
||||
return $this->idexternal;
|
||||
}
|
||||
|
||||
public function setIdexternal(?string $idexternal): self
|
||||
{
|
||||
$this->idexternal = $idexternal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
50
src/Entity/Script.php
Normal file
50
src/Entity/Script.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Script
|
||||
*
|
||||
* @ORM\Table(name="script")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ScriptRepository")
|
||||
*/
|
||||
class Script
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="string", nullable=false)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
381
src/Entity/Scrum.php
Normal file
381
src/Entity/Scrum.php
Normal file
@ -0,0 +1,381 @@
|
||||
<?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="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 __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();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
159
src/Entity/Scrumcolumn.php
Normal file
159
src/Entity/Scrumcolumn.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Scrumcolumn
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="scrumcolumn", uniqueConstraints={@ORM\UniqueConstraint(name="gitealabel", columns={"giteaid","scrum_id"})} )
|
||||
*/
|
||||
class Scrumcolumn
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $rowid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteaid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $giteajson;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrum", inversedBy="scrumcolumns")
|
||||
*/
|
||||
private $scrum;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Scrumissue", mappedBy="scrumcolumn", cascade={"persist"}, orphanRemoval=true)
|
||||
* @ORM\OrderBy({"giteamilestonename" = "DESC", "rowid" = "ASC"})
|
||||
*/
|
||||
private $scrumissues;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->scrumissues = 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 getRowid(): ?int
|
||||
{
|
||||
return $this->rowid;
|
||||
}
|
||||
|
||||
public function setRowid(int $rowid): self
|
||||
{
|
||||
$this->rowid = $rowid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteaid(): ?int
|
||||
{
|
||||
return $this->giteaid;
|
||||
}
|
||||
|
||||
public function setGiteaid(int $giteaid): self
|
||||
{
|
||||
$this->giteaid = $giteaid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteajson(): ?array
|
||||
{
|
||||
return $this->giteajson;
|
||||
}
|
||||
|
||||
public function setGiteajson(array $giteajson): self
|
||||
{
|
||||
$this->giteajson = $giteajson;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrum(): ?Scrum
|
||||
{
|
||||
return $this->scrum;
|
||||
}
|
||||
|
||||
public function setScrum(?Scrum $scrum): self
|
||||
{
|
||||
$this->scrum = $scrum;
|
||||
|
||||
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->setScrumcolumn($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->getScrumcolumn() === $this) {
|
||||
$scrumissue->setScrumcolumn(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
220
src/Entity/Scrumissue.php
Normal file
220
src/Entity/Scrumissue.php
Normal file
@ -0,0 +1,220 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* Scrumissue
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="scrumissue", uniqueConstraints={@ORM\UniqueConstraint(name="giteaissue", columns={"giteaid","scrum_id"})} )
|
||||
* @UniqueEntity("giteaissue", message="Il existe déjà une issues liée avec ce id gitea")
|
||||
*/
|
||||
class Scrumissue
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $rowid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float")
|
||||
*/
|
||||
private $weight=0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteaid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteanumber;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
private $giteastate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
*/
|
||||
private $giteatitle;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $giteamilestone;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
*
|
||||
*/
|
||||
private $giteamilestonename;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $giteajson;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrum", inversedBy="Scrumissues")
|
||||
*/
|
||||
private $scrum;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrumcolumn", inversedBy="Scrumissues")
|
||||
*/
|
||||
private $scrumcolumn;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getRowid(): ?int
|
||||
{
|
||||
return $this->rowid;
|
||||
}
|
||||
|
||||
public function setRowid(int $rowid): self
|
||||
{
|
||||
$this->rowid = $rowid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteaid(): ?int
|
||||
{
|
||||
return $this->giteaid;
|
||||
}
|
||||
|
||||
public function setGiteaid(int $giteaid): self
|
||||
{
|
||||
$this->giteaid = $giteaid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteanumber(): ?int
|
||||
{
|
||||
return $this->giteanumber;
|
||||
}
|
||||
|
||||
public function setGiteanumber(int $giteanumber): self
|
||||
{
|
||||
$this->giteanumber = $giteanumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteastate(): ?string
|
||||
{
|
||||
return $this->giteastate;
|
||||
}
|
||||
|
||||
public function setGiteastate(string $giteastate): self
|
||||
{
|
||||
$this->giteastate = $giteastate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteatitle(): ?string
|
||||
{
|
||||
return $this->giteatitle;
|
||||
}
|
||||
|
||||
public function setGiteatitle(string $giteatitle): self
|
||||
{
|
||||
$this->giteatitle = $giteatitle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteamilestone(): ?int
|
||||
{
|
||||
return $this->giteamilestone;
|
||||
}
|
||||
|
||||
public function setGiteamilestone(?int $giteamilestone): self
|
||||
{
|
||||
$this->giteamilestone = $giteamilestone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteajson(): ?array
|
||||
{
|
||||
return $this->giteajson;
|
||||
}
|
||||
|
||||
public function setGiteajson(array $giteajson): self
|
||||
{
|
||||
$this->giteajson = $giteajson;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrum(): ?Scrum
|
||||
{
|
||||
return $this->scrum;
|
||||
}
|
||||
|
||||
public function setScrum(?Scrum $scrum): self
|
||||
{
|
||||
$this->scrum = $scrum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrumcolumn(): ?Scrumcolumn
|
||||
{
|
||||
return $this->scrumcolumn;
|
||||
}
|
||||
|
||||
public function setScrumcolumn(?Scrumcolumn $scrumcolumn): self
|
||||
{
|
||||
$this->scrumcolumn = $scrumcolumn;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteamilestonename(): ?string
|
||||
{
|
||||
return $this->giteamilestonename;
|
||||
}
|
||||
|
||||
public function setGiteamilestonename(?string $giteamilestonename): self
|
||||
{
|
||||
$this->giteamilestonename = $giteamilestonename;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWeight(): ?float
|
||||
{
|
||||
return $this->weight;
|
||||
}
|
||||
|
||||
public function setWeight(float $weight): self
|
||||
{
|
||||
$this->weight = $weight;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
116
src/Entity/Scrumpriority.php
Normal file
116
src/Entity/Scrumpriority.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Scrumpriority
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="scrumpriority", uniqueConstraints={@ORM\UniqueConstraint(name="gitealabel", columns={"giteaid","scrum_id"})} )
|
||||
*/
|
||||
class Scrumpriority
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $rowid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteaid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $giteajson;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrum", inversedBy="scrumprioritys")
|
||||
*/
|
||||
private $scrum;
|
||||
|
||||
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 getRowid(): ?int
|
||||
{
|
||||
return $this->rowid;
|
||||
}
|
||||
|
||||
public function setRowid(int $rowid): self
|
||||
{
|
||||
$this->rowid = $rowid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteaid(): ?int
|
||||
{
|
||||
return $this->giteaid;
|
||||
}
|
||||
|
||||
public function setGiteaid(int $giteaid): self
|
||||
{
|
||||
$this->giteaid = $giteaid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteajson(): ?array
|
||||
{
|
||||
return $this->giteajson;
|
||||
}
|
||||
|
||||
public function setGiteajson(array $giteajson): self
|
||||
{
|
||||
$this->giteajson = $giteajson;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrum(): ?Scrum
|
||||
{
|
||||
return $this->scrum;
|
||||
}
|
||||
|
||||
public function setScrum(?Scrum $scrum): self
|
||||
{
|
||||
$this->scrum = $scrum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
116
src/Entity/Scrumteam.php
Normal file
116
src/Entity/Scrumteam.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Scrumteam
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="scrumteam", uniqueConstraints={@ORM\UniqueConstraint(name="gitealabel", columns={"giteaid","scrum_id"})} )
|
||||
*/
|
||||
class Scrumteam
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $rowid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteaid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $giteajson;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrum", inversedBy="scrumteams")
|
||||
*/
|
||||
private $scrum;
|
||||
|
||||
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 getRowid(): ?int
|
||||
{
|
||||
return $this->rowid;
|
||||
}
|
||||
|
||||
public function setRowid(int $rowid): self
|
||||
{
|
||||
$this->rowid = $rowid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteaid(): ?int
|
||||
{
|
||||
return $this->giteaid;
|
||||
}
|
||||
|
||||
public function setGiteaid(int $giteaid): self
|
||||
{
|
||||
$this->giteaid = $giteaid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteajson(): ?array
|
||||
{
|
||||
return $this->giteajson;
|
||||
}
|
||||
|
||||
public function setGiteajson(array $giteajson): self
|
||||
{
|
||||
$this->giteajson = $giteajson;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrum(): ?Scrum
|
||||
{
|
||||
return $this->scrum;
|
||||
}
|
||||
|
||||
public function setScrum(?Scrum $scrum): self
|
||||
{
|
||||
$this->scrum = $scrum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
116
src/Entity/Scrumtype.php
Normal file
116
src/Entity/Scrumtype.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Scrumtype
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="scrumtype", uniqueConstraints={@ORM\UniqueConstraint(name="gitealabel", columns={"giteaid","scrum_id"})} )
|
||||
*/
|
||||
class Scrumtype
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $rowid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $giteaid;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $giteajson;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrum", inversedBy="scrumtypes")
|
||||
*/
|
||||
private $scrum;
|
||||
|
||||
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 getRowid(): ?int
|
||||
{
|
||||
return $this->rowid;
|
||||
}
|
||||
|
||||
public function setRowid(int $rowid): self
|
||||
{
|
||||
$this->rowid = $rowid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteaid(): ?int
|
||||
{
|
||||
return $this->giteaid;
|
||||
}
|
||||
|
||||
public function setGiteaid(int $giteaid): self
|
||||
{
|
||||
$this->giteaid = $giteaid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGiteajson(): ?array
|
||||
{
|
||||
return $this->giteajson;
|
||||
}
|
||||
|
||||
public function setGiteajson(array $giteajson): self
|
||||
{
|
||||
$this->giteajson = $giteajson;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrum(): ?Scrum
|
||||
{
|
||||
return $this->scrum;
|
||||
}
|
||||
|
||||
public function setScrum(?Scrum $scrum): self
|
||||
{
|
||||
$this->scrum = $scrum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
339
src/Entity/User.php
Normal file
339
src/Entity/User.php
Normal file
@ -0,0 +1,339 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
* @ORM\Table(name="user",uniqueConstraints={@ORM\UniqueConstraint(name="username", columns={"username"})})
|
||||
* @UniqueEntity("username", message="Ce nom d'utilisateur existe dèja")
|
||||
*/
|
||||
|
||||
class User implements UserInterface, \Serializable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="username", type="string", length=255)
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="password", type="string", length=255)
|
||||
*/
|
||||
private $password;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(name="roles", type="array", length=255)
|
||||
*/
|
||||
private $roles = array();
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="salt", type="string", length=255)
|
||||
*/
|
||||
private $salt = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $firstname;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $lastname;
|
||||
private $displayname;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=200, nullable=true, options={"default" : 0})
|
||||
*/
|
||||
private $avatar;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $apikey;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="preference", type="array", nullable=true)
|
||||
*/
|
||||
private $preference;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="usergroupe",
|
||||
* joinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $groups;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Scrum", inversedBy="users", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="userscrum",
|
||||
* joinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="scrum", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $scrums;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->groups = new ArrayCollection();
|
||||
$this->scrums = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getSalt(): ?string
|
||||
{
|
||||
return $this->salt;
|
||||
}
|
||||
|
||||
public function setPassword($password): self
|
||||
{
|
||||
if($password!=$this->password&&$password!=""&&!is_null($password)){
|
||||
$this->salt = uniqid(mt_rand(), true);
|
||||
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($password . $this->salt)) . $this->salt);
|
||||
|
||||
$this->password = $hash;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function getRoles(): ?array
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
|
||||
public function hasRole(string $role): ?bool
|
||||
{
|
||||
return in_array($role,$this->roles);
|
||||
}
|
||||
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
return serialize(array(
|
||||
$this->id,
|
||||
$this->username,
|
||||
$this->password,
|
||||
$this->salt,
|
||||
));
|
||||
}
|
||||
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
list (
|
||||
$this->id,
|
||||
$this->username,
|
||||
$this->password,
|
||||
$this->salt
|
||||
) = unserialize($serialized, array('allowed_classes' => false));
|
||||
}
|
||||
|
||||
public function getDisplayname()
|
||||
{
|
||||
return $this->firstname." ".$this->lastname;
|
||||
}
|
||||
|
||||
public function setId(int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setUsername(string $username): self
|
||||
{
|
||||
$this->username = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSalt(string $salt): self
|
||||
{
|
||||
$this->salt = $salt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstname(): ?string
|
||||
{
|
||||
return $this->firstname;
|
||||
}
|
||||
|
||||
public function setFirstname(?string $firstname): self
|
||||
{
|
||||
$this->firstname = $firstname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastname(): ?string
|
||||
{
|
||||
return $this->lastname;
|
||||
}
|
||||
|
||||
public function setLastname(?string $lastname): self
|
||||
{
|
||||
$this->lastname = $lastname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvatar(): ?string
|
||||
{
|
||||
if($this->avatar)
|
||||
return $this->avatar;
|
||||
else
|
||||
return "noavatar.png";
|
||||
}
|
||||
|
||||
public function setAvatar(?string $avatar): self
|
||||
{
|
||||
$this->avatar = $avatar;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getApikey(): ?string
|
||||
{
|
||||
return $this->apikey;
|
||||
}
|
||||
|
||||
public function setApikey(?string $apikey): self
|
||||
{
|
||||
$this->apikey = $apikey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Group[]
|
||||
*/
|
||||
public function getGroups(): Collection
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
public function addGroup(Group $group): self
|
||||
{
|
||||
if (!$this->groups->contains($group)) {
|
||||
$this->groups[] = $group;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeGroup(Group $group): self
|
||||
{
|
||||
if ($this->groups->contains($group)) {
|
||||
$this->groups->removeElement($group);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Scrum[]
|
||||
*/
|
||||
public function getScrums(): Collection
|
||||
{
|
||||
return $this->scrums;
|
||||
}
|
||||
|
||||
public function addScrum(Scrum $scrum): self
|
||||
{
|
||||
if (!$this->scrums->contains($scrum)) {
|
||||
$this->scrums[] = $scrum;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeScrum(Scrum $scrum): self
|
||||
{
|
||||
if ($this->scrums->contains($scrum)) {
|
||||
$this->scrums->removeElement($scrum);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPreference(): ?array
|
||||
{
|
||||
return $this->preference;
|
||||
}
|
||||
|
||||
public function setPreference(?array $preference): self
|
||||
{
|
||||
$this->preference = $preference;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user