<?php
namespace App\Entity;
use App\Repository\CertModelRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CertModelRepository::class)
*/
class CertModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255)
*/
private $code;
/**
* @ORM\OneToMany(targetEntity=CertCertificat::class, mappedBy="model", orphanRemoval=true)
*/
private $certCertificats;
/**
* @ORM\OneToOne(targetEntity=CertModelResultFinal::class, inversedBy="certModel", cascade={"persist", "remove"})
*/
private $resultFinal;
/**
* @ORM\OneToMany(targetEntity=CertModelResultDetail::class, mappedBy="model", orphanRemoval=true)
*/
private $certModelResultDetails;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $defaultMaterial;
public function __construct()
{
$this->certCertificats = new ArrayCollection();
$this->certModelResultDetails = 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 getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
/**
* @return Collection<int, CertCertificat>
*/
public function getCertCertificats(): Collection
{
return $this->certCertificats;
}
public function addCertCertificat(CertCertificat $certCertificat): self
{
if (!$this->certCertificats->contains($certCertificat)) {
$this->certCertificats[] = $certCertificat;
$certCertificat->setModel($this);
}
return $this;
}
public function removeCertCertificat(CertCertificat $certCertificat): self
{
if ($this->certCertificats->removeElement($certCertificat)) {
// set the owning side to null (unless already changed)
if ($certCertificat->getModel() === $this) {
$certCertificat->setModel(null);
}
}
return $this;
}
public function getResultFinal(): ?CertModelResultFinal
{
return $this->resultFinal;
}
public function setResultFinal(?CertModelResultFinal $resultFinal): self
{
$this->resultFinal = $resultFinal;
return $this;
}
/**
* @return Collection<int, CertModelResultDetail>
*/
public function getCertModelResultDetails(): Collection
{
return $this->certModelResultDetails;
}
public function addCertModelResultDetail(CertModelResultDetail $certModelResultDetail): self
{
if (!$this->certModelResultDetails->contains($certModelResultDetail)) {
$this->certModelResultDetails[] = $certModelResultDetail;
$certModelResultDetail->setModel($this);
}
return $this;
}
public function removeCertModelResultDetail(CertModelResultDetail $certModelResultDetail): self
{
if ($this->certModelResultDetails->removeElement($certModelResultDetail)) {
// set the owning side to null (unless already changed)
if ($certModelResultDetail->getModel() === $this) {
$certModelResultDetail->setModel(null);
}
}
return $this;
}
public function getDefaultMaterial(): ?string
{
return $this->defaultMaterial;
}
public function setDefaultMaterial(?string $defaultMaterial): self
{
$this->defaultMaterial = $defaultMaterial;
return $this;
}
}