src/Entity/CertModel.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CertModelRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CertModelRepository::class)
  9.  */
  10. class CertModel
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime_immutable")
  20.      */
  21.     private $createdAt;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $description;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $code;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=CertCertificat::class, mappedBy="model", orphanRemoval=true)
  36.      */
  37.     private $certCertificats;
  38.     /**
  39.      * @ORM\OneToOne(targetEntity=CertModelResultFinal::class, inversedBy="certModel", cascade={"persist", "remove"})
  40.      */
  41.     private $resultFinal;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=CertModelResultDetail::class, mappedBy="model", orphanRemoval=true)
  44.      */
  45.     private $certModelResultDetails;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $defaultMaterial;
  50.     public function __construct()
  51.     {
  52.         $this->certCertificats = new ArrayCollection();
  53.         $this->certModelResultDetails = new ArrayCollection();
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getCreatedAt(): ?\DateTimeImmutable
  60.     {
  61.         return $this->createdAt;
  62.     }
  63.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  64.     {
  65.         $this->createdAt $createdAt;
  66.         return $this;
  67.     }
  68.     public function getTitle(): ?string
  69.     {
  70.         return $this->title;
  71.     }
  72.     public function setTitle(string $title): self
  73.     {
  74.         $this->title $title;
  75.         return $this;
  76.     }
  77.     public function getDescription(): ?string
  78.     {
  79.         return $this->description;
  80.     }
  81.     public function setDescription(?string $description): self
  82.     {
  83.         $this->description $description;
  84.         return $this;
  85.     }
  86.     public function getCode(): ?string
  87.     {
  88.         return $this->code;
  89.     }
  90.     public function setCode(string $code): self
  91.     {
  92.         $this->code $code;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection<int, CertCertificat>
  97.      */
  98.     public function getCertCertificats(): Collection
  99.     {
  100.         return $this->certCertificats;
  101.     }
  102.     public function addCertCertificat(CertCertificat $certCertificat): self
  103.     {
  104.         if (!$this->certCertificats->contains($certCertificat)) {
  105.             $this->certCertificats[] = $certCertificat;
  106.             $certCertificat->setModel($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeCertCertificat(CertCertificat $certCertificat): self
  111.     {
  112.         if ($this->certCertificats->removeElement($certCertificat)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($certCertificat->getModel() === $this) {
  115.                 $certCertificat->setModel(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120.     public function getResultFinal(): ?CertModelResultFinal
  121.     {
  122.         return $this->resultFinal;
  123.     }
  124.     public function setResultFinal(?CertModelResultFinal $resultFinal): self
  125.     {
  126.         $this->resultFinal $resultFinal;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, CertModelResultDetail>
  131.      */
  132.     public function getCertModelResultDetails(): Collection
  133.     {
  134.         return $this->certModelResultDetails;
  135.     }
  136.     public function addCertModelResultDetail(CertModelResultDetail $certModelResultDetail): self
  137.     {
  138.         if (!$this->certModelResultDetails->contains($certModelResultDetail)) {
  139.             $this->certModelResultDetails[] = $certModelResultDetail;
  140.             $certModelResultDetail->setModel($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeCertModelResultDetail(CertModelResultDetail $certModelResultDetail): self
  145.     {
  146.         if ($this->certModelResultDetails->removeElement($certModelResultDetail)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($certModelResultDetail->getModel() === $this) {
  149.                 $certModelResultDetail->setModel(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function getDefaultMaterial(): ?string
  155.     {
  156.         return $this->defaultMaterial;
  157.     }
  158.     public function setDefaultMaterial(?string $defaultMaterial): self
  159.     {
  160.         $this->defaultMaterial $defaultMaterial;
  161.         return $this;
  162.     }
  163. }