src/Entity/Gos/CertificatePathElement.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\Gos\CertificatePathElementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CertificatePathElementRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class CertificatePathElement
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $value;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $type;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $link;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $updatedAt;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=CertificatePath::class, inversedBy="certificatePathElements")
  45.      */
  46.     private $certificatePath;
  47.     /**
  48.      * @ORM\ManyToMany(targetEntity=ProductVariant::class, inversedBy="certificatePathElements")
  49.      */
  50.     private $productVariants;
  51.     public function __construct()
  52.     {
  53.         $this->productVariants = new ArrayCollection();
  54.     }
  55.     /** @ORM\PrePersist() */
  56.     public function prePersist()
  57.     {
  58.         $this->createdAt = new \DateTime();
  59.     }
  60.     /** @ORM\PreUpdate() */
  61.     public function preUpdate()
  62.     {
  63.         $this->updatedAt = new \DateTime();
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     public function setName(string $name): self
  74.     {
  75.         $this->name $name;
  76.         return $this;
  77.     }
  78.     public function getValue(): ?string
  79.     {
  80.         return $this->value;
  81.     }
  82.     public function setValue(?string $value): self
  83.     {
  84.         $this->value $value;
  85.         return $this;
  86.     }
  87.     public function getType(): ?string
  88.     {
  89.         return $this->type;
  90.     }
  91.     public function setType(string $type): self
  92.     {
  93.         $this->type $type;
  94.         return $this;
  95.     }
  96.     public function getLink(): ?string
  97.     {
  98.         return $this->link;
  99.     }
  100.     public function setLink(string $link): self
  101.     {
  102.         $this->link $link;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->createdAt;
  108.     }
  109.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  110.     {
  111.         $this->createdAt $createdAt;
  112.         return $this;
  113.     }
  114.     public function getUpdatedAt(): ?\DateTimeInterface
  115.     {
  116.         return $this->updatedAt;
  117.     }
  118.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  119.     {
  120.         $this->updatedAt $updatedAt;
  121.         return $this;
  122.     }
  123.     public function getCertificatePath(): ?CertificatePath
  124.     {
  125.         return $this->certificatePath;
  126.     }
  127.     public function setCertificatePath(?CertificatePath $certificatePath): self
  128.     {
  129.         $this->certificatePath $certificatePath;
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection|ProductVariant[]
  134.      */
  135.     public function getProductVariants(): Collection
  136.     {
  137.         return $this->productVariants;
  138.     }
  139.     public function addProductVariant(ProductVariant $productVariant): self
  140.     {
  141.         if (!$this->productVariants->contains($productVariant)) {
  142.             $this->productVariants[] = $productVariant;
  143.         }
  144.         return $this;
  145.     }
  146.     public function removeProductVariant(ProductVariant $productVariant): self
  147.     {
  148.         if ($this->productVariants->contains($productVariant)) {
  149.             $this->productVariants->removeElement($productVariant);
  150.         }
  151.         return $this;
  152.     }
  153. }