src/Entity/InjuredInfo.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InjuredInfoRepository;
  4. use Doctrine\Common\Collections\{ ArrayCollectionCollection };
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassInjuredInfoRepository::class)]
  9. class InjuredInfo
  10. {
  11.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\OneToOne(inversedBy'injuredInfo'targetEntityCases::class), ORM\JoinColumn(nullablefalse)]
  14.     private $case;
  15.     #[ORM\Column(type'string'length255), Assert\NotBlank]
  16.     private $broughtBy;
  17.     #[ORM\Column(type'string'length100), Assert\NotBlank]
  18.     private $officeLetterRef;
  19.     #[ORM\Column(type'date'), Assert\NotBlank]
  20.     private $dateBrought;
  21.     #[ORM\Column(type'datetime'), Assert\NotBlank]
  22.     private $examinedAt;
  23.     #[ORM\Column(type'string'length255), Assert\NotBlank]
  24.     private $idMark1;
  25.     #[ORM\Column(type'string'length255), Assert\NotBlank]
  26.     private $idMark2;
  27.     #[ORM\OneToMany(targetEntityInjuryDetail::class, mappedBy'injuredInfo'orphanRemovaltrue)]
  28.     private $injuries;
  29.     #[Gedmo\Timestampable(on'create'), ORM\Column(type'datetime')]
  30.     private $createdAt;
  31.     function __construct()
  32.     {
  33.         $this->injuries = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getCase(): ?Cases
  40.     {
  41.         return $this->case;
  42.     }
  43.     public function setCase(Cases $case): self
  44.     {
  45.         $this->case $case;
  46.         return $this;
  47.     }
  48.     public function getBroughtBy(): ?string
  49.     {
  50.         return $this->broughtBy;
  51.     }
  52.     public function setBroughtBy(string $broughtBy): self
  53.     {
  54.         $this->broughtBy $broughtBy;
  55.         return $this;
  56.     }
  57.     public function getOfficeLetterRef(): ?string
  58.     {
  59.         return $this->officeLetterRef;
  60.     }
  61.     public function setOfficeLetterRef(string $officeLetterRef): self
  62.     {
  63.         $this->officeLetterRef $officeLetterRef;
  64.         return $this;
  65.     }
  66.     public function getDateBrought(): ?\DateTimeInterface
  67.     {
  68.         return $this->dateBrought;
  69.     }
  70.     public function setDateBrought(\DateTimeInterface $dateBrought): self
  71.     {
  72.         $this->dateBrought $dateBrought;
  73.         return $this;
  74.     }
  75.     public function getExaminedAt(): ?\DateTimeInterface
  76.     {
  77.         return $this->examinedAt;
  78.     }
  79.     public function setExaminedAt(\DateTimeInterface $examinedAt): self
  80.     {
  81.         $this->examinedAt $examinedAt;
  82.         return $this;
  83.     }
  84.     public function getIdMark1(): ?string
  85.     {
  86.         return $this->idMark1;
  87.     }
  88.     public function setIdMark1(string $idMark1): self
  89.     {
  90.         $this->idMark1 $idMark1;
  91.         return $this;
  92.     }
  93.     public function getIdMark2(): ?string
  94.     {
  95.         return $this->idMark2;
  96.     }
  97.     public function setIdMark2(string $idMark2): self
  98.     {
  99.         $this->idMark2 $idMark2;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection|InjuryDetail[]
  104.      */
  105.     public function getInjuries(): Collection
  106.     {
  107.         return $this->injuries;
  108.     }
  109.     public function addInjury(InjuryDetail $injury): self
  110.     {
  111.         if (!$this->injuries->contains($injury)) {
  112.             $this->injuries[] = $injury;
  113.             $injury->setInjuredInfo($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function getCreatedAt(): ?\DateTimeInterface
  118.     {
  119.         return $this->createdAt;
  120.     }
  121. }