websocket init
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
|
||||
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;
|
||||
|
||||
@ -85,6 +87,16 @@ class Scrumissue
|
||||
*/
|
||||
private $scrumsprint;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Userpoker", mappedBy="scrumissue", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
private $userpokers;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userpokers = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -234,6 +246,37 @@ class Scrumissue
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Userpoker[]
|
||||
*/
|
||||
public function getUserpokers(): Collection
|
||||
{
|
||||
return $this->userpokers;
|
||||
}
|
||||
|
||||
public function addUserpoker(Userpoker $userpoker): self
|
||||
{
|
||||
if (!$this->userpokers->contains($userpoker)) {
|
||||
$this->userpokers[] = $userpoker;
|
||||
$userpoker->setScrumissue($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUserpoker(Userpoker $userpoker): self
|
||||
{
|
||||
if ($this->userpokers->contains($userpoker)) {
|
||||
$this->userpokers->removeElement($userpoker);
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($userpoker->getScrumissue() === $this) {
|
||||
$userpoker->setScrumissue(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -85,6 +85,11 @@ class User implements UserInterface, \Serializable
|
||||
*/
|
||||
private $preference;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Userpoker", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
private $userpokers;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="usergroupe",
|
||||
@ -107,6 +112,7 @@ class User implements UserInterface, \Serializable
|
||||
{
|
||||
$this->groups = new ArrayCollection();
|
||||
$this->scrums = new ArrayCollection();
|
||||
$this->userpokers = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getUsername(): ?string
|
||||
@ -172,7 +178,7 @@ class User implements UserInterface, \Serializable
|
||||
|
||||
public function getDisplayname()
|
||||
{
|
||||
return $this->firstname." ".$this->lastname;
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function setId(int $id): self
|
||||
@ -336,4 +342,35 @@ class User implements UserInterface, \Serializable
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Userpoker[]
|
||||
*/
|
||||
public function getUserpokers(): Collection
|
||||
{
|
||||
return $this->userpokers;
|
||||
}
|
||||
|
||||
public function addUserpoker(Userpoker $userpoker): self
|
||||
{
|
||||
if (!$this->userpokers->contains($userpoker)) {
|
||||
$this->userpokers[] = $userpoker;
|
||||
$userpoker->setUser($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUserpoker(Userpoker $userpoker): self
|
||||
{
|
||||
if ($this->userpokers->contains($userpoker)) {
|
||||
$this->userpokers->removeElement($userpoker);
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($userpoker->getUser() === $this) {
|
||||
$userpoker->setUser(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
82
src/Entity/Userpoker.php
Normal file
82
src/Entity/Userpoker.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Userpoker
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="userpoker")
|
||||
*/
|
||||
class Userpoker
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="integer")
|
||||
*
|
||||
*/
|
||||
private $nb;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Scrumissue", inversedBy="userpokers")
|
||||
*/
|
||||
private $scrumissue;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="userpokers")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getNb(): ?int
|
||||
{
|
||||
return $this->nb;
|
||||
}
|
||||
|
||||
public function setNb(int $nb): self
|
||||
{
|
||||
$this->nb = $nb;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScrumissue(): ?Scrumissue
|
||||
{
|
||||
return $this->scrumissue;
|
||||
}
|
||||
|
||||
public function setScrumissue(?Scrumissue $scrumissue): self
|
||||
{
|
||||
$this->scrumissue = $scrumissue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): self
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user