Added new models to pass to repositories when counting visits of any kind

This commit is contained in:
Alejandro Celaya
2021-05-22 20:16:32 +02:00
parent 9fa32b5b6b
commit 6327ed814a
14 changed files with 168 additions and 57 deletions

View File

@@ -22,6 +22,7 @@ use Shlinkio\Shlink\Core\Repository\TagRepository;
use Shlinkio\Shlink\Core\Repository\VisitRepository;
use Shlinkio\Shlink\Core\Repository\VisitRepositoryInterface;
use Shlinkio\Shlink\Core\Visit\Model\VisitsStats;
use Shlinkio\Shlink\Core\Visit\Persistence\VisitsCountFiltering;
use Shlinkio\Shlink\Rest\Entity\ApiKey;
class VisitsStatsHelper implements VisitsStatsHelperInterface
@@ -38,7 +39,10 @@ class VisitsStatsHelper implements VisitsStatsHelperInterface
/** @var VisitRepository $visitsRepo */
$visitsRepo = $this->em->getRepository(Visit::class);
return new VisitsStats($visitsRepo->countVisits($apiKey), $visitsRepo->countOrphanVisits());
return new VisitsStats(
$visitsRepo->countVisits($apiKey),
$visitsRepo->countOrphanVisits(new VisitsCountFiltering()),
);
}
/**