src/V4/Webhook/Message/WebhookTriggeredMessage.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\V4\Webhook\Message;
  4. use App\V4\Event\PostPersistEvent;
  5. use DateTimeImmutable;
  6. class WebhookTriggeredMessage
  7. {
  8.     /**
  9.      * @var string
  10.      */
  11.     private $eventId;
  12.     /**
  13.      * @var PostPersistEvent
  14.      */
  15.     private $event;
  16.     /**
  17.      * @var string
  18.      */
  19.     private $webhookId;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $customerId;
  24.     /**
  25.      * @var DateTimeImmutable
  26.      */
  27.     private $triggeredAt;
  28.     public function __construct(PostPersistEvent $eventstring $webhookIdstring $customerId)
  29.     {
  30.         $this->event $event;
  31.         $this->webhookId $webhookId;
  32.         $this->customerId $customerId;
  33.         $this->eventId uniqid();
  34.         $this->triggeredAt = new DateTimeImmutable();
  35.     }
  36.     public function getEventId(): string
  37.     {
  38.         return $this->eventId;
  39.     }
  40.     public function getEvent(): PostPersistEvent
  41.     {
  42.         return $this->event;
  43.     }
  44.     public function getWebhookId(): string
  45.     {
  46.         return $this->webhookId;
  47.     }
  48.     public function getCustomerId(): string
  49.     {
  50.         return $this->customerId;
  51.     }
  52.     public function getTriggeredAt(): DateTimeImmutable
  53.     {
  54.         return $this->triggeredAt;
  55.     }
  56. }