/** * {@inheritDoc} */ public function setEvent($event) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEvent', array($event)); return parent::setEvent($event); }
public function queueWebhook(Webhook $webhook, $event, $payload, array $serializationGroups = []) { $serializedPayload = $this->serializeData($payload, $serializationGroups); $queue = new WebhookQueue(); $queue->setWebhook($webhook); $queue->setDateAdded(new \DateTime()); $queue->setEvent($event); $queue->setPayload($serializedPayload); // fire events for when the queues are created if ($this->dispatcher->hasListeners(WebhookEvents::WEBHOOK_QUEUE_ON_ADD)) { $webhookQueueEvent = $event = new Events\WebhookQueueEvent($queue, $webhook, true); $this->dispatcher->dispatch(WebhookEvents::WEBHOOK_QUEUE_ON_ADD, $webhookQueueEvent); } return $queue; }