src/Entity/DeliveryState.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\ToArray;
  4. use App\Enum\DeliveryState\Status;
  5. use App\Repository\DeliveryStateRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=DeliveryStateRepository::class)
  9.  */
  10. class DeliveryState
  11. {
  12.     use ToArray;
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=MessageLog::class, inversedBy="deliveryStates")
  21.      */
  22.     private $message;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Device::class)
  25.      */
  26.     private $device;
  27.     /**
  28.      * @ORM\Column(type="enum", options={"values"="delivery_state_enum"})
  29.      */
  30.     private $status Status::STATUS_PENDING;
  31.     /**
  32.      * @ORM\Column(type="integer")
  33.      */
  34.     private $attempts 0;
  35.     /**
  36.      * @ORM\Column(type="datetime", nullable=true)
  37.      */
  38.     private $lastTryAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $ackedAt;
  43.     /**
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $deliveredAt;
  47.     public function __construct()
  48.     {
  49.         $this->createdAt = new \DateTime();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getMessage(): ?MessageLog
  56.     {
  57.         return $this->message;
  58.     }
  59.     public function setMessage(?MessageLog $message): self
  60.     {
  61.         $this->message $message;
  62.         return $this;
  63.     }
  64.     public function getDevice(): ?Device
  65.     {
  66.         return $this->device;
  67.     }
  68.     public function setDevice(?Device $device): self
  69.     {
  70.         $this->device $device;
  71.         return $this;
  72.     }
  73.     public function getStatus()
  74.     {
  75.         return $this->status;
  76.     }
  77.     public function setStatus($status): self
  78.     {
  79.         $this->status $status;
  80.         return $this;
  81.     }
  82.     public function getAttempts(): ?int
  83.     {
  84.         return $this->attempts;
  85.     }
  86.     public function setAttempts(int $attempts): self
  87.     {
  88.         $this->attempts $attempts;
  89.         return $this;
  90.     }
  91.     public function getLastTryAt(): ?\DateTimeInterface
  92.     {
  93.         return $this->lastTryAt;
  94.     }
  95.     public function setLastTryAt(?\DateTimeInterface $lastTryAt): self
  96.     {
  97.         $this->lastTryAt $lastTryAt;
  98.         return $this;
  99.     }
  100.     public function getAckedAt(): ?\DateTimeInterface
  101.     {
  102.         return $this->ackedAt;
  103.     }
  104.     public function setAckedAt(?\DateTimeInterface $ackedAt): self
  105.     {
  106.         $this->ackedAt $ackedAt;
  107.         return $this;
  108.     }
  109.     public function getDeliveredAt(): ?\DateTimeInterface
  110.     {
  111.         return $this->deliveredAt;
  112.     }
  113.     public function setDeliveredAt(?\DateTimeInterface $deliveredAt): self
  114.     {
  115.         $this->deliveredAt $deliveredAt;
  116.         return $this;
  117.     }
  118. }