Updated setting short URL tags so that it accepts providing the domain

This commit is contained in:
Alejandro Celaya
2020-02-01 22:59:21 +01:00
parent 5d1d9dcac3
commit 6858dc4785
5 changed files with 11 additions and 9 deletions

View File

@@ -47,9 +47,9 @@ class ShortUrlService implements ShortUrlServiceInterface
* @param string[] $tags
* @throws ShortUrlNotFoundException
*/
public function setTagsByShortCode(string $shortCode, array $tags = []): ShortUrl
public function setTagsByShortCode(ShortUrlIdentifier $identifier, array $tags = []): ShortUrl
{
$shortUrl = $this->urlResolver->resolveShortUrl(new ShortUrlIdentifier($shortCode));
$shortUrl = $this->urlResolver->resolveShortUrl($identifier);
$shortUrl->setTags($this->tagNamesToEntities($this->em, $tags));
$this->em->flush();

View File

@@ -22,7 +22,7 @@ interface ShortUrlServiceInterface
* @param string[] $tags
* @throws ShortUrlNotFoundException
*/
public function setTagsByShortCode(string $shortCode, array $tags = []): ShortUrl;
public function setTagsByShortCode(ShortUrlIdentifier $identifier, array $tags = []): ShortUrl;
/**
* @throws ShortUrlNotFoundException