src/Entity/bilan/Situation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\bilan;
  3. use App\Repository\bilan\SituationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SituationRepository::class)
  9.  */
  10. class Situation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=SituationRisque::class, mappedBy="situation")
  24.      */
  25.     private $situationRisques;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $createdAt;
  30.     /**
  31.      * @ORM\Column(type="datetime", nullable=true)
  32.      */
  33.     private $updatedAt;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $createdBy;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $updatedBy;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Task::class, inversedBy="situations")
  44.      * @ORM\JoinColumn(nullable=false)
  45.      */
  46.     private $task;
  47.     public function __construct()
  48.     {
  49.         $this->situationRisques = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getTitle(): ?string
  56.     {
  57.         return $this->title;
  58.     }
  59.     public function setTitle(string $title): self
  60.     {
  61.         $this->title $title;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection|SituationRisque[]
  66.      */
  67.     public function getSituationRisques(): Collection
  68.     {
  69.         return $this->situationRisques;
  70.     }
  71.     public function addSituationRisque(SituationRisque $situationRisque): self
  72.     {
  73.         if (!$this->situationRisques->contains($situationRisque)) {
  74.             $this->situationRisques[] = $situationRisque;
  75.             $situationRisque->setSituation($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removeSituationRisque(SituationRisque $situationRisque): self
  80.     {
  81.         if ($this->situationRisques->removeElement($situationRisque)) {
  82.             // set the owning side to null (unless already changed)
  83.             if ($situationRisque->getSituation() === $this) {
  84.                 $situationRisque->setSituation(null);
  85.             }
  86.         }
  87.         return $this;
  88.     }
  89.     public function getCreatedAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->createdAt;
  92.     }
  93.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  94.     {
  95.         $this->createdAt $createdAt;
  96.         return $this;
  97.     }
  98.     public function getUpdatedAt(): ?\DateTimeInterface
  99.     {
  100.         return $this->updatedAt;
  101.     }
  102.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  103.     {
  104.         $this->updatedAt $updatedAt;
  105.         return $this;
  106.     }
  107.     public function getCreatedBy(): ?string
  108.     {
  109.         return $this->createdBy;
  110.     }
  111.     public function setCreatedBy(string $createdBy): self
  112.     {
  113.         $this->createdBy $createdBy;
  114.         return $this;
  115.     }
  116.     public function getUpdatedBy(): ?string
  117.     {
  118.         return $this->updatedBy;
  119.     }
  120.     public function setUpdatedBy(?string $updatedBy): self
  121.     {
  122.         $this->updatedBy $updatedBy;
  123.         return $this;
  124.     }
  125.     public function getTask(): ?Task
  126.     {
  127.         return $this->task;
  128.     }
  129.     public function setTask(?Task $task): self
  130.     {
  131.         $this->task $task;
  132.         return $this;
  133.     }
  134. }