/**
  * @param RedirectionInterface $redirection
  *
  * @return FacadeInterface
  *
  * @throws TransformerParameterTypeException
  */
 public function transform($redirection)
 {
     if (!$redirection instanceof RedirectionInterface) {
         throw new TransformerParameterTypeException();
     }
     $facade = $this->newFacade();
     $facade->id = $redirection->getId();
     $facade->siteName = $redirection->getSiteName();
     $facade->routePattern = $redirection->getRoutePattern();
     $facade->locale = $redirection->getLocale();
     $facade->redirection = $redirection->getUrl();
     if ($redirection->getNodeId()) {
         $facade->redirection = $redirection->getNodeId();
     }
     $facade->permanent = $redirection->isPermanent();
     $facade->addRight('can_edit', $this->authorizationChecker->isGranted(ContributionActionInterface::EDIT, $redirection));
     return $facade;
 }
 /**
  * @param string               $message
  * @param RedirectionInterface $redirection
  */
 protected function sendLog($message, RedirectionInterface $redirection)
 {
     $this->logger->info($message, array('redirection_pattern' => $redirection->getRoutePattern(), 'redirection_site_name' => $redirection->getSiteName()));
 }