2018-05-01 19:35:12 +02:00
|
|
|
<?php
|
2019-10-05 17:26:10 +02:00
|
|
|
|
2018-05-01 19:35:12 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Shlinkio\Shlink\Core\Model;
|
|
|
|
|
|
2018-09-20 20:38:51 +02:00
|
|
|
final class CreateShortUrlData
|
2018-05-01 19:35:12 +02:00
|
|
|
{
|
2020-06-24 20:21:05 +02:00
|
|
|
private string $longUrl;
|
2019-12-29 22:27:00 +01:00
|
|
|
private array $tags;
|
|
|
|
|
private ShortUrlMeta $meta;
|
2018-05-01 19:35:12 +02:00
|
|
|
|
2020-06-24 20:21:05 +02:00
|
|
|
public function __construct(string $longUrl, array $tags = [], ?ShortUrlMeta $meta = null)
|
|
|
|
|
{
|
2018-05-01 19:35:12 +02:00
|
|
|
$this->longUrl = $longUrl;
|
|
|
|
|
$this->tags = $tags;
|
2019-01-29 13:55:47 +01:00
|
|
|
$this->meta = $meta ?? ShortUrlMeta::createEmpty();
|
2018-05-01 19:35:12 +02:00
|
|
|
}
|
|
|
|
|
|
2020-06-24 20:21:05 +02:00
|
|
|
public function getLongUrl(): string
|
2018-05-01 19:35:12 +02:00
|
|
|
{
|
|
|
|
|
return $this->longUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-06-24 20:21:05 +02:00
|
|
|
* @return string[]
|
2018-05-01 19:35:12 +02:00
|
|
|
*/
|
|
|
|
|
public function getTags(): array
|
|
|
|
|
{
|
|
|
|
|
return $this->tags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getMeta(): ShortUrlMeta
|
|
|
|
|
{
|
|
|
|
|
return $this->meta;
|
|
|
|
|
}
|
|
|
|
|
}
|