Ejemplo n.º 1
0
 /**
  * @test
  * @group library
  */
 public function getUnitsFromPageContentSuccess()
 {
     $reparser = new CmsReparser();
     $result = $reparser->reparseAndUpdatePage($this->page, $this->template);
     $this->assertTrue($result);
 }
Ejemplo n.º 2
0
 /**
  * reparsing the page unsing specific template
  *
  * @param \Cms\Data\Page      $page
  * @param \Cms\Data\Template  $template
  * @return boolean
  */
 private function doReparsePage(\Cms\Data\Page $page, \Cms\Data\Template $template)
 {
     if ($page->getTemplatecontentchecksum() != $template->getContentchecksum()) {
         try {
             if (Reparser::reparseAndUpdatePage($page, $template)) {
                 return true;
             }
         } catch (\Exception $e) {
             $data = method_exists($e, 'getData') ? $e->getData() : array();
             $data['pageId'] = $page->getId();
             $data['pageName'] = $page->getName();
             throw new \Cms\Exception(801, __METHOD__, __LINE__, $data, $e);
         }
     }
     return false;
 }