src/Entity/Incident.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\IncidentRepository;
  4. use App\Traits\TimeStampTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassIncidentRepository::class)]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Incident
  12. {
  13.     use TimeStampTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(length100)]
  19.     private ?string $code null;
  20.     #[ORM\ManyToOne(inversedBy'incidents')]
  21.     private ?Location $location null;
  22.     #[ORM\Column(length25)]
  23.     private ?string $process null;
  24.     #[ORM\Column]
  25.     private ?bool $status null;
  26.     #[ORM\ManyToOne(inversedBy'incidents')]
  27.     private ?Service $service null;
  28.     #[ORM\Column(type'text' ,nullabletrue)]
  29.     private ?string $description null;
  30.     #[ORM\ManyToOne(inversedBy'incidents')]
  31.     private ?Entreprise $marchand null;
  32.     #[ORM\Column(length10nullabletrue)]
  33.     private ?string $step null;
  34.     #[ORM\Column(typeTypes::DECIMALprecision10scale2nullabletrue)]
  35.     private ?string $depense null;
  36.     #[ORM\Column(length50nullabletrue)]
  37.     private ?string $numeroticket null;
  38.     #[ORM\OneToMany(mappedBy'incident'targetEntityIncidentUpdate::class)]
  39.     private Collection $incidentUpdates;
  40.     #[ORM\ManyToOne(inversedBy'incidents')]
  41.     private ?User $createdBy null;
  42.     #[ORM\ManyToOne(inversedBy'incidents')]
  43.     private ?Residence $residence null;
  44.     #[ORM\Column(length50nullabletrue)]
  45.     private ?string $title null;
  46.     #[ORM\Column(length100nullabletrue)]
  47.     private ?string $initiateBy null;
  48.     public function __construct()
  49.     {
  50.         $this->incidentUpdates = new ArrayCollection();
  51.     }
  52.     /**
  53.      * Set id.
  54.      *
  55.      * @param int $id
  56.      *
  57.      * @return Habitat
  58.      */
  59.     public function setId($id)
  60.     {
  61.         $this->id $id;
  62.         return $this;
  63.     }
  64.     public function getId()
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getCode(): ?string
  69.     {
  70.         return $this->code;
  71.     }
  72.     public function setCode(string $code): static
  73.     {
  74.         $this->code $code;
  75.         return $this;
  76.     }
  77.     public function getLocation(): ?Location
  78.     {
  79.         return $this->location;
  80.     }
  81.     public function setLocation(?Location $location): static
  82.     {
  83.         $this->location $location;
  84.         return $this;
  85.     }
  86.     public function getProcess(): ?string
  87.     {
  88.         return $this->process;
  89.     }
  90.     public function setProcess(string $process): static
  91.     {
  92.         $this->process $process;
  93.         return $this;
  94.     }
  95.     public function isStatus(): ?bool
  96.     {
  97.         return $this->status;
  98.     }
  99.     public function setStatus(bool $status): static
  100.     {
  101.         $this->status $status;
  102.         return $this;
  103.     }
  104.     public function getService(): ?Service
  105.     {
  106.         return $this->service;
  107.     }
  108.     public function setService(?Service $service): static
  109.     {
  110.         $this->service $service;
  111.         return $this;
  112.     }
  113.     public function getDescription(): ?string
  114.     {
  115.         return $this->description;
  116.     }
  117.     public function setDescription(?string $description): static
  118.     {
  119.         $this->description $description;
  120.         return $this;
  121.     }
  122.     public function getMarchand(): ?Entreprise
  123.     {
  124.         return $this->marchand;
  125.     }
  126.     public function setMarchand(?Entreprise $marchand): static
  127.     {
  128.         $this->marchand $marchand;
  129.         return $this;
  130.     }
  131.     public function getStep(): ?string
  132.     {
  133.         return $this->step;
  134.     }
  135.     public function setStep(?string $step): static
  136.     {
  137.         $this->step $step;
  138.         return $this;
  139.     }
  140.     public function getDepense(): ?string
  141.     {
  142.         return $this->depense;
  143.     }
  144.     public function setDepense(?string $depense): static
  145.     {
  146.         $this->depense $depense;
  147.         return $this;
  148.     }
  149.     public function getNumeroticket(): ?string
  150.     {
  151.         return $this->numeroticket;
  152.     }
  153.     public function setNumeroticket(?string $numeroticket): static
  154.     {
  155.         $this->numeroticket $numeroticket;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, IncidentUpdate>
  160.      */
  161.     public function getIncidentUpdates(): Collection
  162.     {
  163.         return $this->incidentUpdates;
  164.     }
  165.     public function addIncidentUpdate(IncidentUpdate $incidentUpdate): static
  166.     {
  167.         if (!$this->incidentUpdates->contains($incidentUpdate)) {
  168.             $this->incidentUpdates->add($incidentUpdate);
  169.             $incidentUpdate->setIncident($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeIncidentUpdate(IncidentUpdate $incidentUpdate): static
  174.     {
  175.         if ($this->incidentUpdates->removeElement($incidentUpdate)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($incidentUpdate->getIncident() === $this) {
  178.                 $incidentUpdate->setIncident(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183.     public function getCreatedBy(): ?User
  184.     {
  185.         return $this->createdBy;
  186.     }
  187.     public function setCreatedBy(?User $createdBy): static
  188.     {
  189.         $this->createdBy $createdBy;
  190.         return $this;
  191.     }
  192.     public function getResidence(): ?Residence
  193.     {
  194.         return $this->residence;
  195.     }
  196.     public function setResidence(?Residence $residence): static
  197.     {
  198.         $this->residence $residence;
  199.         return $this;
  200.     }
  201.     public function getTitle(): ?string
  202.     {
  203.         return $this->title;
  204.     }
  205.     public function setTitle(?string $title): static
  206.     {
  207.         $this->title $title;
  208.         return $this;
  209.     }
  210.     public function getInitiateBy(): ?string
  211.     {
  212.         return $this->initiateBy;
  213.     }
  214.     public function setInitiateBy(?string $initiateBy): static
  215.     {
  216.         $this->initiateBy $initiateBy;
  217.         return $this;
  218.     }
  219. }