Add collection and new vocab + mess with repository

This commit is contained in:
2024-11-04 17:16:16 +01:00
parent f8e470b096
commit 0a41ff4a7b
28 changed files with 2599 additions and 38 deletions

View File

@@ -2,14 +2,14 @@
namespace App\Entity;
//use App\Repository\UserRepository;
use App\Repository\BibliographyRepository;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\DBAL\Types\Types;
use App\RecordStatus;
use Doctrine\Common\Collections\Collection as DoctrineCollection;
#[ORM\Entity()]
#[ORM\Entity(repositoryClass: BibliographyRepository::class)]
#[ORM\Table(name: 'bibliography')]
class Bibliography
{
@@ -42,6 +42,20 @@ class Bibliography
#[ORM\Column(length: 100, name: 'creator')]
private ?string $creator = null;
#[ORM\JoinTable(name: 'rel_riferimento_collezione')]
#[ORM\JoinColumn(name: 'Bibliografia_id_bib', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'Collezione_id_coll', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Collection::class)]
private DoctrineCollection $collections;
private DoctrineCollection $documents;
private DoctrineCollection $objects;
private DoctrineCollection $persons;
private DoctrineCollection $sites;
public function getId(): ?int
{
return $this->id;
@@ -143,4 +157,16 @@ class Bibliography
return $this;
}
public function getCollections(): ?DoctrineCollection
{
return $this->collections;
}
public function setCollections(DoctrineCollection $collections): static
{
$this->collections = $collections;
return $this;
}
}