Files
domain-watchdog/src/Entity/WatchListTrigger.php

64 lines
1.5 KiB
PHP
Raw Normal View History

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)]
#[Groups(['watchlist:list', 'watchlist:item', 'watchlist:create'])]
2024-07-23 03:05:35 +02:00
private ?string $event = null;
2024-07-20 23:14:03 +02:00
#[ORM\Id]
2024-08-15 03:04:31 +02:00
#[ORM\ManyToOne(targetEntity: WatchList::class, cascade: ['persist'], inversedBy: 'watchListTriggers')]
#[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)]
#[Groups(['watchlist:list', 'watchlist:item', 'watchlist:create'])]
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;
}
}