mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +00:00
chore: shift targets to realtime
This commit is contained in:
parent
88a6616cf8
commit
55e7633bd1
2 changed files with 29 additions and 23 deletions
|
|
@ -62,7 +62,6 @@ class Event
|
|||
protected array $params = [];
|
||||
protected array $sensitive = [];
|
||||
protected array $payload = [];
|
||||
protected array $targets = [];
|
||||
protected array $context = [];
|
||||
protected ?Document $project = null;
|
||||
protected ?Document $user = null;
|
||||
|
|
@ -233,28 +232,6 @@ class Event
|
|||
return $this->payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set targets for this event.
|
||||
*
|
||||
* @param array $targets
|
||||
* @return array
|
||||
*/
|
||||
public function setTargets(array $targets): self
|
||||
{
|
||||
$this->targets = $targets;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get targets for this event.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTargets(): array
|
||||
{
|
||||
return $this->targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set context for this event.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -7,10 +7,17 @@ use Utopia\Database\Document;
|
|||
|
||||
class Realtime extends Event
|
||||
{
|
||||
protected array $targets = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Realtime payload for this event.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRealtimePayload(): array
|
||||
{
|
||||
$payload = [];
|
||||
|
|
@ -24,6 +31,28 @@ class Realtime extends Event
|
|||
return $payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set targets for this realtime event.
|
||||
*
|
||||
* @param array $targets
|
||||
* @return array
|
||||
*/
|
||||
public function setTargets(array $targets): self
|
||||
{
|
||||
$this->targets = $targets;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get targets for this realtime event.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTargets(): array
|
||||
{
|
||||
return $this->targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Event.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue