protected function deepCopyPageTranslation(PageTranslation $translation, Page $parent)
 {
     $copy = new PageTranslation();
     $copy->setLocale($translation->getLocale());
     $copy->setObject($parent);
     $copy->setEnabled($translation->getEnabled());
     $copy->setName($translation->getName());
     $copy->setDescription($translation->getDescription());
     $copy->setTitle($translation->getTitle());
     $copy->setSlug($translation->getSlug());
     $copy->setUrl($translation->getUrl());
     $copy->setCustomUrl($translation->getCustomUrl());
     $copy->setMetaKeyword($translation->getMetaKeyword());
     $copy->setMetaDescription($translation->getMetaDescription());
     return $copy;
 }
 /**
  * {@inheritdoc}
  */
 public function load(SnapshotInterface $snapshot)
 {
     $page = $this->pageManager->create();
     $page->setRouteName($snapshot->getRouteName());
     $page->setPageAlias($snapshot->getPageAlias());
     $page->setType($snapshot->getType());
     $page->setCustomUrl($snapshot->getUrl());
     $page->setUrl($snapshot->getUrl());
     $page->setPosition($snapshot->getPosition());
     $page->setDecorate($snapshot->getDecorate());
     $page->setSite($snapshot->getSite());
     $page->setEnabled($snapshot->getEnabled());
     $content = $this->fixPageContent($snapshot->getContent());
     $icon = $content['icon_id'] ? $this->registry->getManager()->getRepository('SymbioOrangeGateMediaBundle:Media')->findOneById($content['icon_id']) : null;
     $page->setId($content['id']);
     $page->setJavascript($content['javascript']);
     $page->setStylesheet($content['stylesheet']);
     $page->setRawHeaders($content['raw_headers']);
     $page->setTitle($content['title']);
     $page->setDescription($content['description']);
     $page->setIcon($icon);
     $page->setMetaDescription($content['meta_description']);
     $page->setMetaKeyword($content['meta_keyword']);
     $page->setName($content['name']);
     $page->setSlug($content['slug']);
     $page->setTemplateCode($content['template_code']);
     $page->setRequestMethod($content['request_method']);
     if (array_key_exists('cssClass', $content)) {
         $page->setCssClass($content['cssClass']);
     }
     $createdAt = new \DateTime();
     $createdAt->setTimestamp($content['created_at']);
     $page->setCreatedAt($createdAt);
     $updatedAt = new \DateTime();
     $updatedAt->setTimestamp($content['updated_at']);
     $page->setUpdatedAt($updatedAt);
     foreach ($snapshot->getTranslations() as $locale => $strans) {
         $ptrans = new PageTranslation();
         $ptrans->setObject($page);
         $ptrans->setLocale($locale);
         $ptrans->setEnabled($strans->getEnabled());
         $ptrans->setName($strans->getName());
         $ptrans->setUrl($strans->getUrl());
         $content = $strans->getContent();
         $ptrans->setObject($page);
         $ptrans->setLocale($locale);
         $ptrans->setTitle($content['title']);
         $ptrans->setDescription($content['description']);
         $ptrans->setMetaDescription($content['meta_description']);
         $ptrans->setMetaKeyword($content['meta_keyword']);
         $ptrans->setName($content['name']);
         $ptrans->setSlug($content['slug']);
         $page->addTranslation($ptrans);
     }
     return $page;
 }