<?phpnamespace App\Entity;use App\Enum\TelegramCampaignMessage\Insert;use App\Repository\TelegramCampaignMessageRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TelegramCampaignMessageRepository::class) */class TelegramCampaignMessage{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="text", nullable=true) */ private $text; /** * @ORM\ManyToOne(targetEntity=Image::class) */ private $image; /** * @ORM\ManyToOne(targetEntity=TelegramCampaign::class, inversedBy="messages") */ private $telegramCampaign; /** * @ORM\Column(type="boolean", nullable=true) */ private $sendPaymentRequisites; /** * Не-персистентное поле для загрузки нового изображения через форму */ private $newImage; /** * @ORM\ManyToMany(targetEntity=Image::class) */ private $images; public function __construct() { $this->images = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getText(): ?string { return $this->text; } public function setText(?string $text): self { $this->text = $text; return $this; } public function getImage(): ?Image { return $this->image; } public function setImage(?Image $image): self { $this->image = $image; return $this; } public function getTelegramCampaign(): ?TelegramCampaign { return $this->telegramCampaign; } public function setTelegramCampaign(?TelegramCampaign $telegramCampaign): self { $this->telegramCampaign = $telegramCampaign; return $this; } public function isSendPaymentRequisites(): ?bool { return $this->sendPaymentRequisites; } public function setSendPaymentRequisites(?bool $sendPaymentRequisites): self { $this->sendPaymentRequisites = $sendPaymentRequisites; return $this; } public function getNewImage(): ?string { return $this->newImage; } public function setNewImage(?string $newImage): self { $this->newImage = $newImage; return $this; } /** * @return Collection<int, Image> */ public function getImages(): Collection { return $this->images; } public function addImage(Image $image): self { if (!$this->images->contains($image)) { $this->images[] = $image; } return $this; } public function removeImage(Image $image): self { $this->images->removeElement($image); return $this; }}