Implemented how to reprocess the locations of all existing visits

This commit is contained in:
Alejandro Celaya
2020-03-28 09:12:15 +01:00
parent fcce18b059
commit fb8ab0b5fe
6 changed files with 71 additions and 11 deletions

View File

@@ -40,6 +40,15 @@ class VisitRepository extends EntityRepository implements VisitRepositoryInterfa
return $this->findVisitsForQuery($qb, $blockSize);
}
public function findAllVisits(int $blockSize = self::DEFAULT_BLOCK_SIZE): iterable
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('v')
->from(Visit::class, 'v');
return $this->findVisitsForQuery($qb, $blockSize);
}
private function findVisitsForQuery(QueryBuilder $qb, int $blockSize): iterable
{
$originalQueryBuilder = $qb->setMaxResults($blockSize)

View File

@@ -15,12 +15,17 @@ interface VisitRepositoryInterface extends ObjectRepository
/**
* @return iterable|Visit[]
*/
public function findUnlocatedVisits(int $defaultBlockSize = self::DEFAULT_BLOCK_SIZE): iterable;
public function findUnlocatedVisits(int $blockSize = self::DEFAULT_BLOCK_SIZE): iterable;
/**
* @return iterable|Visit[]
*/
public function findVisitsWithEmptyLocation(int $defaultBlockSize = self::DEFAULT_BLOCK_SIZE): iterable;
public function findVisitsWithEmptyLocation(int $blockSize = self::DEFAULT_BLOCK_SIZE): iterable;
/**
* @return iterable|Visit[]
*/
public function findAllVisits(int $blockSize = self::DEFAULT_BLOCK_SIZE): iterable;
/**
* @return Visit[]