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

30 lines
679 B
PHP
Raw Normal View History

2024-07-11 22:20:20 +02:00
<?php
namespace App\Entity;
use App\Repository\EntityEventRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EntityEventRepository::class)]
#[ORM\UniqueConstraint(
2025-02-18 01:29:29 +01:00
columns: ['action', 'date', 'entity_uid']
)]
2024-07-11 22:20:20 +02:00
class EntityEvent extends Event
{
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
2025-02-18 01:29:29 +01:00
#[ORM\JoinColumn(name: 'entity_uid', referencedColumnName: 'id', nullable: false)]
2024-07-11 22:20:20 +02:00
private ?Entity $entity = null;
public function getEntity(): ?Entity
{
return $this->entity;
}
public function setEntity(?Entity $entity): static
{
$this->entity = $entity;
return $this;
}
}