add tagging

This commit is contained in:
team 1
2026-02-21 16:23:34 +01:00
parent 5a3852db12
commit cf5b473034
23 changed files with 1984 additions and 85 deletions

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'document_tag')]
class DocumentTag
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Document::class, inversedBy: 'documentTags')]
#[ORM\JoinColumn(name: 'document_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private Document $document;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Tag::class)]
#[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private Tag $tag;
public function __construct(Document $document, Tag $tag)
{
$this->document = $document;
$this->tag = $tag;
}
public function getDocument(): Document
{
return $this->document;
}
public function getTag(): Tag
{
return $this->tag;
}
}