<?php
namespace App\Entity;
use App\Repository\InjuredInfoRepository;
use Doctrine\Common\Collections\{ ArrayCollection, Collection };
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: InjuredInfoRepository::class)]
class InjuredInfo
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\OneToOne(inversedBy: 'injuredInfo', targetEntity: Cases::class), ORM\JoinColumn(nullable: false)]
private $case;
#[ORM\Column(type: 'string', length: 255), Assert\NotBlank]
private $broughtBy;
#[ORM\Column(type: 'string', length: 100), Assert\NotBlank]
private $officeLetterRef;
#[ORM\Column(type: 'date'), Assert\NotBlank]
private $dateBrought;
#[ORM\Column(type: 'datetime'), Assert\NotBlank]
private $examinedAt;
#[ORM\Column(type: 'string', length: 255), Assert\NotBlank]
private $idMark1;
#[ORM\Column(type: 'string', length: 255), Assert\NotBlank]
private $idMark2;
#[ORM\OneToMany(targetEntity: InjuryDetail::class, mappedBy: 'injuredInfo', orphanRemoval: true)]
private $injuries;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $createdAt;
function __construct()
{
$this->injuries = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCase(): ?Cases
{
return $this->case;
}
public function setCase(Cases $case): self
{
$this->case = $case;
return $this;
}
public function getBroughtBy(): ?string
{
return $this->broughtBy;
}
public function setBroughtBy(string $broughtBy): self
{
$this->broughtBy = $broughtBy;
return $this;
}
public function getOfficeLetterRef(): ?string
{
return $this->officeLetterRef;
}
public function setOfficeLetterRef(string $officeLetterRef): self
{
$this->officeLetterRef = $officeLetterRef;
return $this;
}
public function getDateBrought(): ?\DateTimeInterface
{
return $this->dateBrought;
}
public function setDateBrought(\DateTimeInterface $dateBrought): self
{
$this->dateBrought = $dateBrought;
return $this;
}
public function getExaminedAt(): ?\DateTimeInterface
{
return $this->examinedAt;
}
public function setExaminedAt(\DateTimeInterface $examinedAt): self
{
$this->examinedAt = $examinedAt;
return $this;
}
public function getIdMark1(): ?string
{
return $this->idMark1;
}
public function setIdMark1(string $idMark1): self
{
$this->idMark1 = $idMark1;
return $this;
}
public function getIdMark2(): ?string
{
return $this->idMark2;
}
public function setIdMark2(string $idMark2): self
{
$this->idMark2 = $idMark2;
return $this;
}
/**
* @return Collection|InjuryDetail[]
*/
public function getInjuries(): Collection
{
return $this->injuries;
}
public function addInjury(InjuryDetail $injury): self
{
if (!$this->injuries->contains($injury)) {
$this->injuries[] = $injury;
$injury->setInjuredInfo($this);
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
}