<?phpnamespace App\Entity\Gos;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity() * @ORM\HasLifecycleCallbacks() */class CouponCascadeSettings{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\OneToOne(targetEntity="Coupon", inversedBy="cascadeSettings") */ private $coupon; /** * @ORM\ManyToOne(targetEntity="CouponCascadeType", inversedBy="cascadeSettings") */ private $type; /** * @ORM\ManyToOne(targetEntity="CouponCascadeMethod", inversedBy="cascadeSettings") */ private $method; /** * @ORM\OneToMany(targetEntity="CouponCascadeStep", mappedBy="cascadeSettings", cascade={"persist"}) */ private $steps; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; public function __construct() { $this->steps = 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 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 getType(): ?CouponCascadeType { return $this->type; } public function setType(?CouponCascadeType $type): self { $this->type = $type; return $this; } public function getMethod(): ?CouponCascadeMethod { return $this->method; } public function setMethod(?CouponCascadeMethod $method): self { $this->method = $method; return $this; } /** * @return Collection|CouponCascadeStep[] */ public function getSteps(): Collection { return $this->steps; } public function addStep(CouponCascadeStep $step): self { if (!$this->steps->contains($step)) { $this->steps[] = $step; $step->setCascadeSettings($this); } return $this; } public function removeStep(CouponCascadeStep $step): self { if ($this->steps->contains($step)) { $this->steps->removeElement($step); // set the owning side to null (unless already changed) if ($step->getCascadeSettings() === $this) { $step->setCascadeSettings(null); } } return $this; } public function getCoupon(): ?Coupon { return $this->coupon; } public function setCoupon(?Coupon $coupon): self { $this->coupon = $coupon; return $this; }}