示例#1
0
 public static function applyDeeplinkPerPage(Application_Model_Models_Deeplink $deeplink, Application_Model_Models_Page $page)
 {
     $containerMapper = Application_Model_Mappers_ContainerMapper::getInstance();
     //$containers      = $containerMapper->findByPageId($page->getId());
     $containers = $containerMapper->findContentContainersByPageId($page->getId());
     if (!empty($containers)) {
         foreach ($containers as $container) {
             $initialContentLength = strlen($container->getContent());
             if (Zend_Registry::isRegistered('applied') && Zend_Registry::get('applied') === true) {
                 Zend_Registry::set('applied', false);
                 return;
             }
             $container->setContent(self::applyDeeplink($deeplink, $container->getContent()));
             $container->registerObserver(new Tools_Seo_Watchdog(array('unwatch' => '_updateDeeplinks')));
             $gc = new Tools_Content_GarbageCollector(array('model' => $container));
             $gc->updateContentLinksRelatios();
             if ($initialContentLength != strlen($container->getContent())) {
                 $containerMapper->save($container);
                 $container->notifyObservers();
             }
         }
     }
 }
示例#2
0
 public function delete(Application_Model_Models_Page $page)
 {
     $where = $this->getDbTable()->getAdapter()->quoteInto('id = ?', $page->getId());
     $deleteResult = $this->getDbTable()->delete($where);
     $page->notifyObservers();
     return $deleteResult;
 }