1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00
appwrite/src/Appwrite/Event/Delete.php

50 lines
970 B
PHP
Raw Normal View History

<?php
namespace Appwrite\Event;
use Resque;
use Utopia\Database\Document;
class Delete extends Event
{
protected string $type = '';
protected ?Document $document = null;
public function __construct()
{
parent::__construct(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME);
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getType(): string
{
return $this->type;
}
public function setDocument(Document $document): self
{
$this->document = $document;
return $this;
}
public function getDocument(): Document
{
return $this->document;
}
public function trigger(): string|bool
{
return Resque::enqueue($this->queue, $this->class, [
'project' => $this->project,
'type' => $this->type,
'document' => $this->document,
]);
}
}