mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Created command that allows configuring not found redirects for every domain
This commit is contained in:
@@ -7,6 +7,7 @@ namespace Shlinkio\Shlink\Core\Entity;
|
||||
use JsonSerializable;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||
|
||||
class Domain extends AbstractEntity implements JsonSerializable, NotFoundRedirectConfigInterface
|
||||
{
|
||||
@@ -57,4 +58,11 @@ class Domain extends AbstractEntity implements JsonSerializable, NotFoundRedirec
|
||||
{
|
||||
return $this->baseUrlRedirect !== null;
|
||||
}
|
||||
|
||||
public function configureNotFoundRedirects(NotFoundRedirects $redirects): void
|
||||
{
|
||||
$this->baseUrlRedirect = $redirects->baseUrlRedirect();
|
||||
$this->regular404Redirect = $redirects->regular404Redirect();
|
||||
$this->invalidShortUrlRedirect = $redirects->invalidShortUrlRedirect();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user