feat : add LogFile entity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 13:30:01 +02:00
parent d292ddbbbe
commit 25ca2fb6ca
2 changed files with 92 additions and 0 deletions

72
src/Entity/LogFile.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\LogFileRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ORM\Entity(repositoryClass: LogFileRepository::class)]
class LogFile
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['env:read', 'app:detail'])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['env:read', 'env:write', 'app:detail'])]
private ?string $label = null;
#[ORM\Column(length: 255)]
#[Groups(['env:read', 'env:write', 'app:detail'])]
private ?string $path = null;
#[ORM\ManyToOne(targetEntity: Environment::class, inversedBy: 'logFiles')]
#[ORM\JoinColumn(nullable: false)]
private ?Environment $environment = null;
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
public function getPath(): ?string
{
return $this->path;
}
public function setPath(string $path): static
{
$this->path = $path;
return $this;
}
public function getEnvironment(): ?Environment
{
return $this->environment;
}
public function setEnvironment(?Environment $environment): static
{
$this->environment = $environment;
return $this;
}
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace App\Repository;
use App\Entity\LogFile;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<LogFile>
*/
class LogFileRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, LogFile::class);
}
}