Base du projet 'application ticketing'

This commit is contained in:
2020-02-17 22:28:57 +01:00
parent 2a72ac97ac
commit afa734f96d
64 changed files with 1798 additions and 685 deletions

View File

@ -0,0 +1,83 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\RequestStatusRepository")
*/
class RequestStatus
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=64)
*/
private $label;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Request", mappedBy="status")
*/
private $requests;
public function __construct()
{
$this->requests = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
/**
* @return Collection|Request[]
*/
public function getRequests(): Collection
{
return $this->requests;
}
public function addRequest(Request $request): self
{
if (!$this->requests->contains($request)) {
$this->requests[] = $request;
$request->setStatus($this);
}
return $this;
}
public function removeRequest(Request $request): self
{
if ($this->requests->contains($request)) {
$this->requests->removeElement($request);
// set the owning side to null (unless already changed)
if ($request->getStatus() === $this) {
$request->setStatus(null);
}
}
return $this;
}
}