original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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
docstring_tokens: Adds a redirect to the repository and updates related redirects accordingly .