appwrite/src/Appwrite/Event/Webhook.php

30 lines
686 B
PHP
Raw Normal View History

2024-11-04 15:05:54 +00:00
<?php
namespace Appwrite\Event;
use Utopia\Queue\Connection;
class Webhook extends Event
{
public function __construct(protected Connection $connection)
{
parent::__construct($connection);
$this
->setQueue(Event::WEBHOOK_QUEUE_NAME)
->setClass(Event::WEBHOOK_CLASS_NAME);
}
2024-12-19 11:13:05 +00:00
public function trigger(): string|bool
{
/** Filter out context and trim project to keep the payload small */
$this->context = [];
$this->project = [
'$id' => $this->project->getId(),
'$internalId' => $this->project->getAttribute('internalId'),
];
return parent::trigger();
}
2024-11-04 15:05:54 +00:00
}