mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-17 07:49:54 +03:00
Exposed new short URLs list filtering params
This commit is contained in:
parent
42a5296f93
commit
c3ab871366
3 changed files with 19 additions and 2 deletions
|
@ -21,6 +21,8 @@ class ShortUrlsCountFiltering
|
||||||
public readonly array $tags = [],
|
public readonly array $tags = [],
|
||||||
public readonly ?TagsMode $tagsMode = null,
|
public readonly ?TagsMode $tagsMode = null,
|
||||||
public readonly ?DateRange $dateRange = null,
|
public readonly ?DateRange $dateRange = null,
|
||||||
|
public readonly bool $excludeMaxVisitsReached = false,
|
||||||
|
public readonly bool $excludePastValidUntil = false,
|
||||||
public readonly ?ApiKey $apiKey = null,
|
public readonly ?ApiKey $apiKey = null,
|
||||||
?string $defaultDomain = null,
|
?string $defaultDomain = null,
|
||||||
) {
|
) {
|
||||||
|
@ -37,6 +39,8 @@ class ShortUrlsCountFiltering
|
||||||
$params->tags,
|
$params->tags,
|
||||||
$params->tagsMode,
|
$params->tagsMode,
|
||||||
$params->dateRange,
|
$params->dateRange,
|
||||||
|
$params->excludeMaxVisitsReached,
|
||||||
|
$params->excludePastValidUntil,
|
||||||
$apiKey,
|
$apiKey,
|
||||||
$defaultDomain,
|
$defaultDomain,
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,10 +20,21 @@ class ShortUrlsListFiltering extends ShortUrlsCountFiltering
|
||||||
array $tags = [],
|
array $tags = [],
|
||||||
?TagsMode $tagsMode = null,
|
?TagsMode $tagsMode = null,
|
||||||
?DateRange $dateRange = null,
|
?DateRange $dateRange = null,
|
||||||
|
bool $excludeMaxVisitsReached = false,
|
||||||
|
bool $excludePastValidUntil = false,
|
||||||
?ApiKey $apiKey = null,
|
?ApiKey $apiKey = null,
|
||||||
?string $defaultDomain = null,
|
?string $defaultDomain = null,
|
||||||
) {
|
) {
|
||||||
parent::__construct($searchTerm, $tags, $tagsMode, $dateRange, $apiKey, $defaultDomain);
|
parent::__construct(
|
||||||
|
$searchTerm,
|
||||||
|
$tags,
|
||||||
|
$tagsMode,
|
||||||
|
$dateRange,
|
||||||
|
$excludeMaxVisitsReached,
|
||||||
|
$excludePastValidUntil,
|
||||||
|
$apiKey,
|
||||||
|
$defaultDomain,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fromLimitsAndParams(
|
public static function fromLimitsAndParams(
|
||||||
|
@ -41,6 +52,8 @@ class ShortUrlsListFiltering extends ShortUrlsCountFiltering
|
||||||
$params->tags,
|
$params->tags,
|
||||||
$params->tagsMode,
|
$params->tagsMode,
|
||||||
$params->dateRange,
|
$params->dateRange,
|
||||||
|
$params->excludePastValidUntil,
|
||||||
|
$params->excludePastValidUntil,
|
||||||
$apiKey,
|
$apiKey,
|
||||||
$defaultDomain,
|
$defaultDomain,
|
||||||
);
|
);
|
||||||
|
|
|
@ -74,7 +74,7 @@ class ShortUrlRepositoryAdapterTest extends TestCase
|
||||||
$dateRange = $params->dateRange;
|
$dateRange = $params->dateRange;
|
||||||
|
|
||||||
$this->repo->expects($this->once())->method('countList')->with(
|
$this->repo->expects($this->once())->method('countList')->with(
|
||||||
new ShortUrlsCountFiltering($searchTerm, $tags, TagsMode::ANY, $dateRange, $apiKey),
|
new ShortUrlsCountFiltering($searchTerm, $tags, TagsMode::ANY, $dateRange, apiKey: $apiKey),
|
||||||
);
|
);
|
||||||
$adapter->getNbResults();
|
$adapter->getNbResults();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue