<?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() */class CouponCascadeMethod{ const PriceOverall = 'price-overall'; const ProductsSeparately = 'products-separately'; /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $name; /** * @Gedmo\Slug(fields={"name"}) * @ORM\Column(type="string", length=255, nullable=true) */ private $slug; /** * @ORM\OneToMany(targetEntity="CouponCascadeSettings", mappedBy="method") */ private $cascadeSettings; public function __construct() { $this->cascadeSettings = new ArrayCollection(); } 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 getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } /** * @return Collection|CouponCascadeSettings[] */ public function getCascadeSettings(): Collection { return $this->cascadeSettings; } public function addCascadeSetting(CouponCascadeSettings $cascadeSetting): self { if (!$this->cascadeSettings->contains($cascadeSetting)) { $this->cascadeSettings[] = $cascadeSetting; $cascadeSetting->setMethod($this); } return $this; } public function removeCascadeSetting(CouponCascadeSettings $cascadeSetting): self { if ($this->cascadeSettings->contains($cascadeSetting)) { $this->cascadeSettings->removeElement($cascadeSetting); // set the owning side to null (unless already changed) if ($cascadeSetting->getMethod() === $this) { $cascadeSetting->setMethod(null); } } return $this; }}