From 7e4ad107cfc9f694a0aaabac97e7ea2a28c73c2b Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 3 Jan 2022 00:00:00 +0000 Subject: [PATCH] Searched values in resource titles too. --- .../src/Api/Adapter/AbstractResourceEntityAdapter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/src/Api/Adapter/AbstractResourceEntityAdapter.php b/application/src/Api/Adapter/AbstractResourceEntityAdapter.php index 866192a55a..9bb7fd5d78 100644 --- a/application/src/Api/Adapter/AbstractResourceEntityAdapter.php +++ b/application/src/Api/Adapter/AbstractResourceEntityAdapter.php @@ -279,7 +279,14 @@ protected function buildPropertyQuery(QueryBuilder $qb, array $query) continue 2; } $param = $this->createNamedParameter($qb, $list); + $subqueryAlias = $this->createAlias(); + $subquery = $this->getEntityManager() + ->createQueryBuilder() + ->select("$subqueryAlias.id") + ->from('Omeka\Entity\Resource', $subqueryAlias) + ->where($qb->expr()->eq("$subqueryAlias.title", $param)); $predicateExpr = $qb->expr()->orX( + $qb->expr()->in("$valuesAlias.valueResource", $subquery->getDQL()), $qb->expr()->in("$valuesAlias.value", $param), $qb->expr()->in("$valuesAlias.uri", $param) );