Skip to content

Commit

Permalink
Merge pull request #1630 from ConductionNL/fix/find-objects-by-refere…
Browse files Browse the repository at this point in the history
…nces

ObjectEntityRepository->findByReferences added
  • Loading branch information
bbrands02 authored Mar 22, 2024
2 parents aa6486a + 8de6a4c commit 4ffbaf9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions api/src/Repository/ObjectEntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -974,4 +974,23 @@ private function makeKeySqlFriendly(string $key): string
// todo, probably add more special characters to replace...
return str_replace('-', 'Dash', $key);
}

/**
* Finds all object entities with references.
*
* @param array $references The entity references
*
* @return mixed ObjectEntities
*/
public function findByReferences(array $references)
{
$qb = $this->createQueryBuilder('o')
->innerJoin('o.entity', 'e')
->where('e.reference IN (:references)')
->setParameter('references', $references);

$query = $qb->getQuery();

return $query->getResult();
}//end findByReferences()
}

0 comments on commit 4ffbaf9

Please sign in to comment.