<?phpnamespace App\Entity\Gos;use App\Repository\Gos\CertificatePathElementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CertificatePathElementRepository::class) * @ORM\HasLifecycleCallbacks() */class CertificatePathElement{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $value; /** * @ORM\Column(type="string", length=255) */ private $type; /** * @ORM\Column(type="string", length=255) */ private $link; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=CertificatePath::class, inversedBy="certificatePathElements") */ private $certificatePath; /** * @ORM\ManyToMany(targetEntity=ProductVariant::class, inversedBy="certificatePathElements") */ private $productVariants; public function __construct() { $this->productVariants = new ArrayCollection(); } /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getValue(): ?string { return $this->value; } public function setValue(?string $value): self { $this->value = $value; return $this; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } public function getLink(): ?string { return $this->link; } public function setLink(string $link): self { $this->link = $link; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getCertificatePath(): ?CertificatePath { return $this->certificatePath; } public function setCertificatePath(?CertificatePath $certificatePath): self { $this->certificatePath = $certificatePath; return $this; } /** * @return Collection|ProductVariant[] */ public function getProductVariants(): Collection { return $this->productVariants; } public function addProductVariant(ProductVariant $productVariant): self { if (!$this->productVariants->contains($productVariant)) { $this->productVariants[] = $productVariant; } return $this; } public function removeProductVariant(ProductVariant $productVariant): self { if ($this->productVariants->contains($productVariant)) { $this->productVariants->removeElement($productVariant); } return $this; }}