Documents for not conserved
This commit is contained in:
@@ -46,6 +46,34 @@ class DocumentRepository extends ServiceEntityRepository
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Document[] Returns an array of Document objects
|
||||
*/
|
||||
public function findByNotConserved(int $notConservedId): array
|
||||
{
|
||||
$rsm = new ResultSetMappingBuilder($this->getEntityManager());
|
||||
$rsm->addRootEntityFromClassMetadata('App\Entity\Document', 'd');
|
||||
$query = $this->getEntityManager()->createNativeQuery(
|
||||
'SELECT
|
||||
id,
|
||||
titolo,
|
||||
filename,
|
||||
descrizione,
|
||||
autori,
|
||||
luogo,
|
||||
tipo
|
||||
FROM documento d
|
||||
JOIN non_conserv_documento
|
||||
ON id_documento = d.id
|
||||
WHERE id_non_conserv = :id
|
||||
',
|
||||
$rsm
|
||||
);
|
||||
|
||||
$query->setParameter('id', $notConservedId);
|
||||
|
||||
return $query->getResult();
|
||||
}
|
||||
// /**
|
||||
// * @return Document[] Returns an array of Document objects
|
||||
// */
|
||||
|
||||
Reference in New Issue
Block a user