mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-07 07:43:12 +08:00
Added support for an optional title field in short URLs
This commit is contained in:
@@ -38,6 +38,7 @@ class ShortUrl extends AbstractEntity
|
||||
private ?string $importSource = null;
|
||||
private ?string $importOriginalShortCode = null;
|
||||
private ?ApiKey $authorApiKey = null;
|
||||
private ?string $title = null;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
@@ -72,6 +73,7 @@ class ShortUrl extends AbstractEntity
|
||||
$instance->shortCode = $meta->getCustomSlug() ?? generateRandomShortCode($instance->shortCodeLength);
|
||||
$instance->domain = $relationResolver->resolveDomain($meta->getDomain());
|
||||
$instance->authorApiKey = $meta->getApiKey();
|
||||
$instance->title = $meta->getTitle();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
@@ -157,6 +159,11 @@ class ShortUrl extends AbstractEntity
|
||||
return $this->maxVisits;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function update(
|
||||
ShortUrlEdit $shortUrlEdit,
|
||||
?ShortUrlRelationResolverInterface $relationResolver = null
|
||||
|
||||
Reference in New Issue
Block a user