<?php
namespace App\Entity;
use App\Repository\CertCertificatRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CertCertificatRepository::class)
*/
class CertCertificat
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="certCertificats")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=IctusPharmacie::class, inversedBy="certCertificats")
* @ORM\JoinColumn(nullable=false)
*/
private $pharmacie;
/**
* @ORM\ManyToOne(targetEntity=CertModel::class, inversedBy="certCertificats")
* @ORM\JoinColumn(nullable=false)
*/
private $model;
/**
* @ORM\OneToOne(targetEntity=CertResultFinal::class, inversedBy="certCertificat", cascade={"persist", "remove"})
*/
private $resultFinal;
/**
* @ORM\OneToMany(targetEntity=CertResultDetail::class, mappedBy="certificat", orphanRemoval=true)
*/
private $certResultDetails;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $toolLot;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $toolExpiration;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $tool;
/**
* @ORM\Column(type="integer", length=24)
*/
private $reference;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable();
$this->certResultDetails = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getPharmacie(): ?IctusPharmacie
{
return $this->pharmacie;
}
public function setPharmacie(?IctusPharmacie $pharmacie): self
{
$this->pharmacie = $pharmacie;
return $this;
}
public function getModel(): ?CertModel
{
return $this->model;
}
public function setModel(?CertModel $model): self
{
$this->model = $model;
return $this;
}
public function getResultFinal(): ?CertResultFinal
{
return $this->resultFinal;
}
public function setResultFinal(?CertResultFinal $resultFinal): self
{
$this->resultFinal = $resultFinal;
return $this;
}
/**
* @return Collection<int, CertResultDetail>
*/
public function getCertResultDetails(): Collection
{
return $this->certResultDetails;
}
public function addCertResultDetail(CertResultDetail $certResultDetail): self
{
if (!$this->certResultDetails->contains($certResultDetail)) {
$this->certResultDetails[] = $certResultDetail;
$certResultDetail->setCertificat($this);
}
return $this;
}
public function removeCertResultDetail(CertResultDetail $certResultDetail): self
{
if ($this->certResultDetails->removeElement($certResultDetail)) {
// set the owning side to null (unless already changed)
if ($certResultDetail->getCertificat() === $this) {
$certResultDetail->setCertificat(null);
}
}
return $this;
}
public function getToolLot(): ?string
{
return $this->toolLot;
}
public function setToolLot(?string $toolLot): self
{
$this->toolLot = $toolLot;
return $this;
}
public function getToolExpiration(): ?\DateTimeInterface
{
return $this->toolExpiration;
}
public function setToolExpiration(?\DateTimeInterface $toolExpiration): self
{
$this->toolExpiration = $toolExpiration;
return $this;
}
public function getTool(): ?string
{
return $this->tool;
}
public function setTool(?string $tool): self
{
$this->tool = $tool;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(string $reference): self
{
$this->reference = $reference;
return $this;
}
}