From 6aa1302deae0ef9458bc8c2458aa4390aef39544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 18 Nov 2024 10:56:43 +0100 Subject: [PATCH] Get author for NotConserved --- src/Entity/NotConserved.php | 16 ++++++++++++++++ src/Repository/BibliographyRepository.php | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Entity/NotConserved.php b/src/Entity/NotConserved.php index ccbe679..952ca70 100644 --- a/src/Entity/NotConserved.php +++ b/src/Entity/NotConserved.php @@ -37,6 +37,9 @@ class NotConserved implements \JsonSerializable #[ORM\Column(type: Types::TEXT, nullable: true, name: 'descrizione_breve')] private ?string $shortDescription = null; + #[ORM\Column(name: 'autore_scheda', length: 100, nullable: true)] + private ?string $author = null; + public function getId(): ?int { return $this->id; @@ -133,6 +136,18 @@ class NotConserved implements \JsonSerializable return $this; } + public function getAuthor(): ?string + { + return $this->author; + } + + public function setAuthor(?string $author): static + { + $this->author = $author; + + return $this; + } + public function jsonSerialize(): array { return [ @@ -142,6 +157,7 @@ class NotConserved implements \JsonSerializable 'genericLocation' => $this->genericLocation, 'period' => $this->period, 'shortDescription' => $this->shortDescription, + 'author' => $this->author, 'bibliography' => $this->bibliographies, ]; } diff --git a/src/Repository/BibliographyRepository.php b/src/Repository/BibliographyRepository.php index 83aa2df..9af7d6c 100644 --- a/src/Repository/BibliographyRepository.php +++ b/src/Repository/BibliographyRepository.php @@ -33,7 +33,8 @@ class BibliographyRepository extends ServiceEntityRepository FROM bibliografia b JOIN bibliografia_non_conser ON id_bibliografia = b.id - WHERE id_non_conser = :id', + WHERE id_non_conser = :id + ORDER BY ordine ASC', $rsm );