<?phpnamespace App\Entity\Gos;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;/** * @ORM\Entity(repositoryClass="App\Repository\Gos\PaymentTypeRepository") * @ORM\HasLifecycleCallbacks() */class PaymentType{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="boolean", nullable=true) */ private $isActive; /** * @ORM\Column(type="string", length=100) */ private $name; /** * @Gedmo\Slug(fields={"name"}) * @ORM\Column(type="string", unique=true, length=100) */ private $slug; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\ProductVariant", mappedBy="paymentType") */ private $productVariant; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; public function __construct() { $this->productVariant = new ArrayCollection(); } /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return (string)$this->name; } public function getId(): ?int { return $this->id; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; 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; } /** * @return Collection|ProductVariant[] */ public function getProductVariant(): Collection { return $this->productVariant; } public function addProductVariant(ProductVariant $productVariant): self { if (!$this->productVariant->contains($productVariant)) { $this->productVariant[] = $productVariant; $productVariant->setPaymentType($this); } return $this; } public function removeProductVariant(ProductVariant $productVariant): self { if ($this->productVariant->contains($productVariant)) { $this->productVariant->removeElement($productVariant); // set the owning side to null (unless already changed) if ($productVariant->getPaymentType() === $this) { $productVariant->setPaymentType(null); } } return $this; }}