mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Refactor AccompanyingCourseDocumentRepository.php
Build where clause using StoredObject directly instead\ of based on it's id.
This commit is contained in:
parent
cce04ee490
commit
7c03a25f1a
@ -46,12 +46,11 @@ class AccompanyingCourseDocumentRepository implements ObjectRepository
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function findLinkedCourseDocument(int $storedObjectId): ?AccompanyingCourseDocument {
|
||||
public function findLinkedCourseDocument(StoredObject $storedObject): ?AccompanyingCourseDocument {
|
||||
|
||||
$qb = $this->repository->createQueryBuilder('d');
|
||||
$query = $qb->leftJoin('d.storedObject', 'do')
|
||||
->where('do.id = :storedObjectId')
|
||||
->setParameter('storedObjectId', $storedObjectId)
|
||||
$query = $qb->where('d.storedObject = :storedObject')
|
||||
->setParameter('storedObject', $storedObject)
|
||||
->getQuery();
|
||||
|
||||
return $query->getResult();
|
||||
|
Loading…
x
Reference in New Issue
Block a user