protected function addRedirectByHost($sourceUriPath, $targetUriPath, $statusCode, $host = null)
    {
        $redirect = new Redirect($sourceUriPath, $targetUriPath, $statusCode, $host);
        $this->updateDependingRedirects($redirect);
        $this->persistenceManager->persistAll();
        $this->redirectRepository->add($redirect);
        $this->routerCachingService->flushCachesForUriPath($sourceUriPath);

        return RedirectDto::create($redirect);
    }
protected function addRedirectByHost($sourceUriPath, $targetUriPath, $statusCode, $host = null)
    {
        $redirect = new Redirect($sourceUriPath, $targetUriPath, $statusCode, $host);
        $this->updateDependingRedirects($redirect);
        $this->persistenceManager->persistAll();
        $this->redirectRepository->add($redirect);
        $this->routerCachingService->flushCachesForUriPath($sourceUriPath);

        return RedirectDto::create($redirect);
    }
protected function addRedirectByHost ( $ sourceUriPath , $ targetUriPath , $ statusCode , $ host = null ) { $ redirect = new Redirect ( $ sourceUriPath , $ targetUriPath , $ statusCode , $ host ) ; $ this -> updateDependingRedirects ( $ redirect ) ; $ this -> persistenceManager -> persistAll ( ) ; $ this -> redirectRepository -> add ( $ redirect ) ; $ this -> routerCachingService -> flushCachesForUriPath ( $ sourceUriPath ) ; return RedirectDto :: create ( $ redirect ) ; }
Adds a redirect to the repository and updates related redirects accordingly.

@param string $sourceUriPath the relative URI path that should trigger a redirect
@param string $targetUriPath the relative URI path the redirect should point to
@param int $statusCode the status code of the redirect header
@param string $host the host for the current redirect
@return Redirect the freshly generated redirect DTO instance
@api
Adds a redirect to the repository and updates related redirects accordingly .