mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Fix repositories to fetch entity linked to stored object
getSingleResult() replaced by getOneOrNullResult() to\ avoid error being thrown. Fix naming of properties.
This commit is contained in:
@@ -11,8 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
@@ -258,12 +258,12 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor
|
||||
{
|
||||
$qb = $this->repository->createQueryBuilder('acpw');
|
||||
$query = $qb
|
||||
->join('acpw.evaluations', 'acpwe')
|
||||
->join('acpw.accompanyingPeriodWorkEvaluations', 'acpwe')
|
||||
->join('acpwe.documents', 'acpwed')
|
||||
->where('acpwed.storedObject = :storedObject')
|
||||
->setParameter('storedObject', $storedObject)
|
||||
->getQuery();
|
||||
|
||||
return $query->getResult();
|
||||
return $query->getOneOrNullResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user