ShortUrlServiceInterface.php 994 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core\Service;
  4. use Laminas\Paginator\Paginator;
  5. use Shlinkio\Shlink\Common\Util\DateRange;
  6. use Shlinkio\Shlink\Core\Entity\ShortUrl;
  7. use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
  8. use Shlinkio\Shlink\Core\Model\ShortUrlMeta;
  9. interface ShortUrlServiceInterface
  10. {
  11. /**
  12. * @param string[] $tags
  13. * @param array|string|null $orderBy
  14. *
  15. * @return ShortUrl[]|Paginator
  16. */
  17. public function listShortUrls(
  18. int $page = 1,
  19. ?string $searchQuery = null,
  20. array $tags = [],
  21. $orderBy = null,
  22. ?DateRange $dateRange = null
  23. );
  24. /**
  25. * @param string[] $tags
  26. * @throws ShortUrlNotFoundException
  27. */
  28. public function setTagsByShortCode(string $shortCode, array $tags = []): ShortUrl;
  29. /**
  30. * @throws ShortUrlNotFoundException
  31. */
  32. public function updateMetadataByShortCode(string $shortCode, ShortUrlMeta $shortUrlMeta): ShortUrl;
  33. }