2024-07-20 23:14:03 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
|
|
use App\Config\TriggerAction;
|
|
|
|
|
use App\Repository\EventTriggerRepository;
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
|
|
|
|
|
|
#[ORM\Entity(repositoryClass: EventTriggerRepository::class)]
|
|
|
|
|
class WatchListTrigger
|
|
|
|
|
{
|
|
|
|
|
#[ORM\Id]
|
2024-07-23 03:05:35 +02:00
|
|
|
#[ORM\Column(length: 255)]
|
2024-07-27 20:44:10 +02:00
|
|
|
#[Groups(['watchlist:list', 'watchlist:item', 'watchlist:create', 'watchlist:update'])]
|
2024-07-23 03:05:35 +02:00
|
|
|
private ?string $event = null;
|
2024-07-20 23:14:03 +02:00
|
|
|
|
|
|
|
|
#[ORM\Id]
|
|
|
|
|
#[ORM\ManyToOne(targetEntity: WatchList::class, inversedBy: 'watchListTriggers')]
|
2024-08-07 00:27:04 +02:00
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'token', nullable: false, onDelete: 'CASCADE')]
|
2024-07-20 23:14:03 +02:00
|
|
|
private ?WatchList $watchList = null;
|
|
|
|
|
|
|
|
|
|
#[ORM\Id]
|
|
|
|
|
#[ORM\Column(enumType: TriggerAction::class)]
|
2024-07-27 20:44:10 +02:00
|
|
|
#[Groups(['watchlist:list', 'watchlist:item', 'watchlist:create', 'watchlist:update'])]
|
2024-07-20 23:14:03 +02:00
|
|
|
private ?TriggerAction $action = null;
|
|
|
|
|
|
2024-07-23 03:05:35 +02:00
|
|
|
public function getEvent(): ?string
|
2024-07-20 23:14:03 +02:00
|
|
|
{
|
|
|
|
|
return $this->event;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-23 03:05:35 +02:00
|
|
|
public function setEvent(string $event): static
|
2024-07-20 23:14:03 +02:00
|
|
|
{
|
|
|
|
|
$this->event = $event;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getWatchList(): ?WatchList
|
|
|
|
|
{
|
|
|
|
|
return $this->watchList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setWatchList(?WatchList $watchList): static
|
|
|
|
|
{
|
|
|
|
|
$this->watchList = $watchList;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAction(): ?TriggerAction
|
|
|
|
|
{
|
|
|
|
|
return $this->action;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setAction(TriggerAction $action): static
|
|
|
|
|
{
|
|
|
|
|
$this->action = $action;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
}
|