/**
  * @param RewritingUrl $rewritingUrl
  */
 public function __construct(RewritingUrl $rewritingUrl)
 {
     $this->id = $rewritingUrl->getId();
     $this->url = $rewritingUrl->getUrl();
     $this->view = $rewritingUrl->getView();
     $this->viewLocale = $rewritingUrl->getViewLocale();
     $this->redirected = $rewritingUrl->getRedirected();
     $this->rewritingUrl = $rewritingUrl;
 }
 /**
  * @param $type
  * @param RewritingUrl $result
  * @param $configValues
  * @param $sitemap
  */
 protected function generateSitemapImage($type, $result, $configValues, &$sitemap)
 {
     $event = new ImageEvent();
     $event->setWidth($configValues['width'])->setHeight($configValues['height'])->setQuality($configValues['quality'])->setRotation($configValues['rotation'])->setResizeMode($configValues['resizeMode'])->setBackgroundColor($configValues['bgColor'])->setAllowZoom($configValues['allowZoom']);
     // Put source image file path
     $source_filepath = sprintf("%s%s/%s/%s", THELIA_ROOT, ConfigQuery::read('images_library_path', 'local/media/images'), $type, $result->getVirtualColumn('PRODUCT_FILE'));
     $event->setSourceFilepath($source_filepath);
     $event->setCacheSubdirectory($type);
     try {
         // Dispatch image processing event
         $this->dispatch(TheliaEvents::IMAGE_PROCESS, $event);
         // New sitemap image entry
         $sitemap[] = '
         <url>
             <loc>' . URL::getInstance()->absoluteUrl($result->getUrl()) . '</loc>
             <image:image>
                 <image:loc>' . $event->getFileUrl() . '</image:loc>
                 <image:title>' . htmlspecialchars($result->getVirtualColumn('PRODUCT_TITLE')) . '</image:title>
             </image:image>
         </url>';
     } catch (\Exception $ex) {
     }
 }