mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-08 16:23:12 +08:00
Renamed countVisits to countNonOrphanVisits, and updated its signature to expect a VisitsCountFiltering DTO
This commit is contained in:
@@ -16,7 +16,6 @@ use Shlinkio\Shlink\Core\Visit\Persistence\VisitsCountFiltering;
|
||||
use Shlinkio\Shlink\Core\Visit\Persistence\VisitsListFiltering;
|
||||
use Shlinkio\Shlink\Core\Visit\Spec\CountOfOrphanVisits;
|
||||
use Shlinkio\Shlink\Core\Visit\Spec\CountOfShortUrlVisits;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
|
||||
use const PHP_INT_MAX;
|
||||
|
||||
@@ -181,10 +180,9 @@ class VisitRepository extends EntitySpecificationRepository implements VisitRepo
|
||||
}
|
||||
|
||||
// TODO This should support counting in a date range or excluding bots
|
||||
// TODO Rename to countNonOrphanVisits
|
||||
public function countVisits(?ApiKey $apiKey = null): int
|
||||
public function countNonOrphanVisits(VisitsCountFiltering $filtering): int
|
||||
{
|
||||
return (int) $this->matchSingleScalarResult(new CountOfShortUrlVisits($apiKey));
|
||||
return (int) $this->matchSingleScalarResult(new CountOfShortUrlVisits($filtering->apiKey()));
|
||||
}
|
||||
|
||||
private function createAllVisitsQueryBuilder(VisitsListFiltering $filtering): QueryBuilder
|
||||
|
||||
@@ -10,7 +10,6 @@ use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||
use Shlinkio\Shlink\Core\Visit\Persistence\VisitsCountFiltering;
|
||||
use Shlinkio\Shlink\Core\Visit\Persistence\VisitsListFiltering;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
|
||||
// TODO Split into VisitsListsRepository and VisitsLocationRepository
|
||||
interface VisitRepositoryInterface extends ObjectRepository, EntitySpecificationRepositoryInterface
|
||||
@@ -58,5 +57,5 @@ interface VisitRepositoryInterface extends ObjectRepository, EntitySpecification
|
||||
*/
|
||||
public function findNonOrphanVisits(VisitsListFiltering $filtering): array;
|
||||
|
||||
public function countVisits(?ApiKey $apiKey = null): int;
|
||||
public function countNonOrphanVisits(VisitsCountFiltering $filtering): int;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user