<?phpnamespace App\Entity\Gos;use App\Repository\Gos\SmsSendingMomentRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SmsSendingMomentRepository::class) * @ORM\HasLifecycleCallbacks */class SmsSendingMoment{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=SmsBody::class, mappedBy="smsSendingMoment") */ private $smsBodies; public function __construct() { $this->smsBodies = 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 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|SmsBody[] */ public function getSmsBodies(): Collection { return $this->smsBodies; } public function addSmsBody(SmsBody $smsBody): self { if (!$this->smsBodies->contains($smsBody)) { $this->smsBodies[] = $smsBody; $smsBody->setSmsSendingMoment($this); } return $this; } public function removeSmsBody(SmsBody $smsBody): self { if ($this->smsBodies->contains($smsBody)) { $this->smsBodies->removeElement($smsBody); // set the owning side to null (unless already changed) if ($smsBody->getSmsSendingMoment() === $this) { $smsBody->setSmsSendingMoment(null); } } return $this; }}