Skip to content

Commit 7ca3603

Browse files
authored
Merge pull request #2244 from omeka/remove-automatic-index-reset
Remove automatic reset of query builder index
2 parents db89905 + 7995236 commit 7ca3603

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

application/src/Api/Adapter/AbstractEntityAdapter.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ public function search(Request $request)
255255
// Begin building the search query.
256256
$entityClass = $this->getEntityClass();
257257

258-
$this->index = 0;
259258
$qb = $this->getEntityManager()
260259
->createQueryBuilder()
261260
->select('omeka_root')
@@ -700,7 +699,6 @@ public function findEntity($criteria, $request = null)
700699
}
701700

702701
$entityClass = $this->getEntityClass();
703-
$this->index = 0;
704702
$qb = $this->getEntityManager()->createQueryBuilder();
705703
$qb->select('omeka_root')->from($entityClass, 'omeka_root');
706704
foreach ($criteria as $field => $value) {
@@ -758,6 +756,14 @@ public function createAlias($prefix = 'omeka_')
758756
return $alias;
759757
}
760758

759+
/**
760+
* Reset the index for query builder named parameters / aliases.
761+
*/
762+
public function resetIndex()
763+
{
764+
$this->index = 0;
765+
}
766+
761767
/**
762768
* Determine whether a string is a valid JSON-LD term.
763769
*
@@ -779,7 +785,6 @@ public function isTerm($term)
779785
*/
780786
public function isUnique(EntityInterface $entity, array $criteria)
781787
{
782-
$this->index = 0;
783788
$qb = $this->getEntityManager()->createQueryBuilder();
784789
$qb->select('e.id')
785790
->from($this->getEntityClass(), 'e');

0 commit comments

Comments
 (0)