<?php
namespace App\Entity;
use App\Repository\DeathCertificateRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: DeathCertificateRepository::class), ORM\Table(name: 'death_certificates')]
class DeathCertificate
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\OneToOne(inversedBy: 'deathCertificate', targetEntity: Cases::class, cascade: ['persist', 'remove']), ORM\JoinColumn(nullable: false)]
private $case;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $immediateCause;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $antecedentCauseB;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $antecedentCauseC;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $otherSignificantConditions;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $onSetInterval;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $howInjuryOccurred;
#[ORM\Column(type: 'string', length: 255), Assert\NotBlank]
private $mannerOfDeath;
#[ORM\Column(type: 'boolean')]
private $isPregnancyDeath = false;
#[ORM\Column(type: 'boolean')]
private $isDelivery = false;
#[ORM\Column(type: 'datetime'), Assert\NotBlank]
private $diedAt;
#[Gedmo\Blameable(on: 'create'), ORM\ManyToOne(targetEntity: User::class), ORM\JoinColumn(nullable: false)]
private $createdBy;
#[Gedmo\Blameable(on: 'update'), ORM\ManyToOne(targetEntity: User::class)]
private $updatedBy;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $createdAt;
#[Gedmo\Timestampable(on: 'update'), ORM\Column(type: 'datetime')]
private $updatedAt;
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 getImmediateCause(): ?string
{
return $this->immediateCause;
}
public function setImmediateCause(?string $immediateCause): self
{
$this->immediateCause = $immediateCause;
return $this;
}
public function getAntecedentCauseB(): ?string
{
return $this->antecedentCauseB;
}
public function setAntecedentCauseB(?string $antecedentCauseB): self
{
$this->antecedentCauseB = $antecedentCauseB;
return $this;
}
public function getAntecedentCauseC(): ?string
{
return $this->antecedentCauseC;
}
public function setAntecedentCauseC(?string $antecedentCauseC): self
{
$this->antecedentCauseC = $antecedentCauseC;
return $this;
}
public function getOtherSignificantConditions(): ?string
{
return $this->otherSignificantConditions;
}
public function setOtherSignificantConditions(?string $otherSignificantConditions): self
{
$this->otherSignificantConditions = $otherSignificantConditions;
return $this;
}
public function getOnSetInterval(): ?string
{
return $this->onSetInterval;
}
public function setOnSetInterval(?string $onSetInterval): self
{
$this->onSetInterval = $onSetInterval;
return $this;
}
public function getHowInjuryOccurred(): ?string
{
return $this->howInjuryOccurred;
}
public function setHowInjuryOccurred(?string $howInjuryOccurred): self
{
$this->howInjuryOccurred = $howInjuryOccurred;
return $this;
}
public function getMannerOfDeath(): ?string
{
return $this->mannerOfDeath;
}
public function setMannerOfDeath(string $mannerOfDeath): self
{
$this->mannerOfDeath = $mannerOfDeath;
return $this;
}
public function getIsPregnancyDeath(): ?bool
{
return $this->isPregnancyDeath;
}
public function setIsPregnancyDeath(bool $isPregnancyDeath): self
{
$this->isPregnancyDeath = $isPregnancyDeath;
return $this;
}
public function getIsDelivery(): ?bool
{
return $this->isDelivery;
}
public function setIsDelivery(bool $isDelivery): self
{
$this->isDelivery = $isDelivery;
return $this;
}
public function getDiedAt(): ?\DateTimeInterface
{
return $this->diedAt;
}
public function setDiedAt(\DateTimeInterface $diedAt): self
{
$this->diedAt = $diedAt;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
}