chore: shift targets to realtime

This commit is contained in:
Chirag Aggarwal 2025-02-18 14:04:59 +00:00
parent 88a6616cf8
commit 55e7633bd1
2 changed files with 29 additions and 23 deletions

View file

@ -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.
*

View file

@ -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.
*