src/Entity/TelegramCampaignDeliveryState.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\TelegramCampaignDeliveryState\Status;
  4. use App\Repository\TelegramCampaignDeliveryStateRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=TelegramCampaignDeliveryStateRepository::class)
  8.  */
  9. class TelegramCampaignDeliveryState
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="enum", options={"values"="telegram_campaign_delivery_state_enum"})
  19.      */
  20.     private $status Status::STATUS_PENDING;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=TelegramCampaignParticipant::class, inversedBy="deliveryStates")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $telegramCampaignParticipant;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=TelegramCampaignMessage::class)
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $message;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getMessage(): ?TelegramCampaignMessage
  36.     {
  37.         return $this->message;
  38.     }
  39.     public function setMessage(?TelegramCampaignMessage $message): self
  40.     {
  41.         $this->message $message;
  42.         return $this;
  43.     }
  44.     public function getStatus()
  45.     {
  46.         return $this->status;
  47.     }
  48.     public function setStatus($status): self
  49.     {
  50.         $this->status $status;
  51.         return $this;
  52.     }
  53.     public function isStatusPending(): bool
  54.     {
  55.         return $this->getStatus() === Status::STATUS_PENDING;
  56.     }
  57.     public function isStatusSent(): bool
  58.     {
  59.         return $this->getStatus() === Status::STATUS_SENT;
  60.     }
  61.     public function getParticipant(): ?TelegramCampaignParticipant
  62.     {
  63.         return $this->participant;
  64.     }
  65.     public function setParticipant(?TelegramCampaignParticipant $participant): self
  66.     {
  67.         $this->participant $participant;
  68.         return $this;
  69.     }
  70.     public function getTelegramCampaignParticipant(): ?TelegramCampaignParticipant
  71.     {
  72.         return $this->telegramCampaignParticipant;
  73.     }
  74.     public function setTelegramCampaignParticipant(?TelegramCampaignParticipant $telegramCampaignParticipant): self
  75.     {
  76.         $this->telegramCampaignParticipant $telegramCampaignParticipant;
  77.         return $this;
  78.     }
  79.     public function isStatusCheckDeleted(): bool
  80.     {
  81.         return $this->getStatus() === Status::STATUS_CHECK_DELETED;
  82.     }
  83. }