✨ feat(admin): Ajoute gestion des administrateurs avec création et suppression.
Ajoute la gestion complète des administrateurs : création, suppression,
logs d'audit, notifications mail (création/suppression) et désinscription.
```
51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\AuditLogRepository;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: AuditLogRepository::class)]
|
|
class AuditLog
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\ManyToOne]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?Account $account = null;
|
|
|
|
#[ORM\Column]
|
|
private \DateTimeImmutable $actionAt;
|
|
|
|
#[ORM\Column(length: 50)]
|
|
private ?string $type = null;
|
|
|
|
#[ORM\Column(type: Types::TEXT)]
|
|
private ?string $message = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $path = null;
|
|
|
|
// Le constructeur force le remplissage des données dès le départ
|
|
public function __construct(Account $account, string $type, string $message, string $path)
|
|
{
|
|
$this->account = $account;
|
|
$this->type = $type;
|
|
$this->message = $message;
|
|
$this->path = $path;
|
|
$this->actionAt = new \DateTimeImmutable();
|
|
}
|
|
|
|
// Uniquement des Getters (Pas de Setters = Pas de modification possible en PHP)
|
|
public function getId(): ?int { return $this->id; }
|
|
public function getAccount(): ?Account { return $this->account; }
|
|
public function getActionAt(): \DateTimeImmutable { return $this->actionAt; }
|
|
public function getType(): ?string { return $this->type; }
|
|
public function getMessage(): ?string { return $this->message; }
|
|
public function getPath(): ?string { return $this->path; }
|
|
}
|