Skip to content

Commit

Permalink
ObjectEntityRepository->findByReferences added
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrands02 committed Mar 22, 2024
1 parent aa6486a commit 8de6a4c
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 8de6a4c

Please sign in to comment.