src/Entity/Gos/OnboardingScheduler.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\OnboardingSchedulerRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=OnboardingSchedulerRepository::class)
  7.  * @ORM\Table(
  8.  *      name="onboarding_scheduler",
  9.  *      indexes={
  10.  *          @ORM\Index(name="idx_schedule_date_status", columns={"schedule_date", "is_successfuly_sent"})
  11.  *      }
  12.  *  )
  13.  */
  14. class OnboardingScheduler
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class)
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $user;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Orders::class)
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private $order;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $notificationType;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $notificationName;
  40.     /**
  41.      * @ORM\Column(type="date")
  42.      */
  43.     private $scheduleDate;
  44.     /**
  45.      * @ORM\Column(type="time", nullable=true)
  46.      */
  47.     private $scheduleTime;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=SmsBody::class)
  50.      */
  51.     private $smsBody;
  52.     /**
  53.      * @ORM\Column(type="datetime", nullable=true)
  54.      */
  55.     private $sentAt;
  56.     /**
  57.      * @ORM\Column(type="boolean", options={"default": false})
  58.      */
  59.     private $isSuccessfulySent false;
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getUser(): User
  65.     {
  66.         return $this->user;
  67.     }
  68.     public function setUser(User $user): self
  69.     {
  70.         $this->user $user;
  71.         return $this;
  72.     }
  73.     public function getOrder(): Orders
  74.     {
  75.         return $this->order;
  76.     }
  77.     public function setOrder(Orders $orders): self
  78.     {
  79.         $this->order $orders;
  80.         return $this;
  81.     }
  82.     public function getNotificationType(): ?int
  83.     {
  84.         return $this->notificationType;
  85.     }
  86.     public function setNotificationType($notificationType): self
  87.     {
  88.         $this->notificationType $notificationType;
  89.         return $this;
  90.     }
  91.     public function getNotificationName(): ?string
  92.     {
  93.         return $this->notificationName;
  94.     }
  95.     public function setNotificationName(?string $notificationName): self
  96.     {
  97.         $this->notificationName $notificationName;
  98.         return $this;
  99.     }
  100.     public function getScheduleDate(): ?\DateTimeInterface
  101.     {
  102.         return $this->scheduleDate;
  103.     }
  104.     public function setScheduleDate(\DateTimeInterface $scheduleDate): self
  105.     {
  106.         $this->scheduleDate $scheduleDate;
  107.         return $this;
  108.     }
  109.     public function getScheduleTime(): ?\DateTimeInterface
  110.     {
  111.         return $this->scheduleTime;
  112.     }
  113.     public function setScheduleTime(\DateTimeInterface $scheduleTime): self
  114.     {
  115.         $this->scheduleTime $scheduleTime;
  116.         return $this;
  117.     }
  118.     public function getSmsBody(): ?SmsBody
  119.     {
  120.         return $this->smsBody;
  121.     }
  122.     public function setSmsBody(?SmsBody $smsBody): self
  123.     {
  124.         $this->smsBody $smsBody;
  125.         return $this;
  126.     }
  127.     public function getSentAt(): ?\DateTimeInterface
  128.     {
  129.         return $this->sentAt;
  130.     }
  131.     public function setSentAt($sentAt): self
  132.     {
  133.         $this->sentAt $sentAt;
  134.         return $this;
  135.     }
  136.     public function getIsSuccessfulySent(): bool
  137.     {
  138.         return $this->isSuccessfulySent;
  139.     }
  140.     public function setIsSuccessfulySent($isSuccessfulySent): self
  141.     {
  142.         $this->isSuccessfulySent $isSuccessfulySent;
  143.         return $this;
  144.     }
  145.     public function markAsSent(): void
  146.     {
  147.         $this->setIsSuccessfulySent(true);
  148.         $this->sentAt = new \DateTime();
  149.     }
  150. }