Ejemplo n.º 1
0
Archivo: Page.php Proyecto: reliv/rcm
 /**
  * savePage
  *
  * @param SiteEntity $siteEntity
  * @param            $pageName
  * @param            $pageRevision
  * @param string     $pageType
  * @param            $saveData
  * @param            $author
  *
  * @return int|null
  */
 public function savePage(SiteEntity $siteEntity, $pageName, $pageRevision, $pageType, $saveData, $author)
 {
     if (empty($pageType)) {
         $pageType = 'n';
     }
     if (!empty($saveData['containers'])) {
         foreach ($saveData['containers'] as $containerName => $containerData) {
             /** @var \Rcm\Entity\Container $container */
             $container = $siteEntity->getContainer($containerName);
             if (empty($container)) {
                 /** @var \Rcm\Repository\Container $containerRepo */
                 $containerRepo = $this->_em->getRepository('\\Rcm\\Entity\\Container');
                 $container = $containerRepo->createContainer($siteEntity, $containerName, $author);
             }
             $this->saveContainer($container, $containerData, $author);
         }
     }
     $page = $this->getPageByName($siteEntity, $pageName, $pageType);
     return $this->saveContainer($page, $saveData['pageContainer'], $author, $pageRevision);
 }