GET for relationship fixed: associated relation displayed

This commit is contained in:
2021-10-26 14:49:12 +02:00
parent 18ca01b0dc
commit b7466c7e85
3 changed files with 41 additions and 7 deletions

View File

@@ -27,7 +27,9 @@ class RelationshipRepository extends ServiceEntityRepository
{
// return all relationships of which person is part? or only where person is the fromPerson?
return $this->createQueryBuilder('r')
->andWhere('r.fromPerson = :val')
->select('r, t') // entity Relationship
->join('r.relation', 't')
->where('r.fromPerson = :val')
->orWhere('r.toPerson = :val')
->setParameter('val', $personId)
->getQuery()