mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Inlcuded tags as part of the ShortUrlMeta
This commit is contained in:
@@ -201,7 +201,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
|
||||
return $qb;
|
||||
}
|
||||
|
||||
public function findOneMatching(array $tags, ShortUrlMeta $meta): ?ShortUrl
|
||||
public function findOneMatching(ShortUrlMeta $meta): ?ShortUrl
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
|
||||
@@ -239,6 +239,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
|
||||
$this->applySpecification($qb, $apiKey->spec(), 's');
|
||||
}
|
||||
|
||||
$tags = $meta->getTags();
|
||||
$tagsAmount = count($tags);
|
||||
if ($tagsAmount === 0) {
|
||||
return $qb->getQuery()->getOneOrNullResult();
|
||||
|
||||
@@ -38,7 +38,7 @@ interface ShortUrlRepositoryInterface extends ObjectRepository, EntitySpecificat
|
||||
|
||||
public function shortCodeIsInUse(string $slug, ?string $domain, ?Specification $spec = null): bool;
|
||||
|
||||
public function findOneMatching(array $tags, ShortUrlMeta $meta): ?ShortUrl;
|
||||
public function findOneMatching(ShortUrlMeta $meta): ?ShortUrl;
|
||||
|
||||
public function importedUrlExists(ImportedShlinkUrl $url): bool;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user