<?phpnamespace App\Entity;use App\Enum\TelegramCampaignDeliveryState\Status;use App\Repository\TelegramCampaignDeliveryStateRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TelegramCampaignDeliveryStateRepository::class) */class TelegramCampaignDeliveryState{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="enum", options={"values"="telegram_campaign_delivery_state_enum"}) */ private $status = Status::STATUS_PENDING; /** * @ORM\ManyToOne(targetEntity=TelegramCampaignParticipant::class, inversedBy="deliveryStates") * @ORM\JoinColumn(nullable=false) */ private $telegramCampaignParticipant; /** * @ORM\ManyToOne(targetEntity=TelegramCampaignMessage::class) * @ORM\JoinColumn(nullable=false) */ private $message; public function getId(): ?int { return $this->id; } public function getMessage(): ?TelegramCampaignMessage { return $this->message; } public function setMessage(?TelegramCampaignMessage $message): self { $this->message = $message; return $this; } public function getStatus() { return $this->status; } public function setStatus($status): self { $this->status = $status; return $this; } public function isStatusPending(): bool { return $this->getStatus() === Status::STATUS_PENDING; } public function isStatusSent(): bool { return $this->getStatus() === Status::STATUS_SENT; } public function getParticipant(): ?TelegramCampaignParticipant { return $this->participant; } public function setParticipant(?TelegramCampaignParticipant $participant): self { $this->participant = $participant; return $this; } public function getTelegramCampaignParticipant(): ?TelegramCampaignParticipant { return $this->telegramCampaignParticipant; } public function setTelegramCampaignParticipant(?TelegramCampaignParticipant $telegramCampaignParticipant): self { $this->telegramCampaignParticipant = $telegramCampaignParticipant; return $this; } public function isStatusCheckDeleted(): bool { return $this->getStatus() === Status::STATUS_CHECK_DELETED; }}