Beispiel #1
0
 public function updateChaveRegistrosAction()
 {
     $this->_disableRender();
     $_where = new ZendT_Db_Where();
     $_where->addFilter("cms_conteudo.id", "79", ">=");
     $_conteudo = new Cms_DataView_Conteudo_MapperView();
     $_conteudo->findAll($_where, '*');
     while ($_conteudo->fetch()) {
         echo $_conteudo->getId()->toPhp() . "<br>";
         $_conteudo->update();
     }
     $_where = new ZendT_Db_Where();
     $_where->addFilter("cms_categoria.id_categoria_pai", "24", "=");
     $_categoria = new Cms_DataView_Categoria_MapperView();
     $_categoria->findAll($_where, '*');
     while ($_categoria->fetch()) {
         echo $_categoria->getId()->toPhp() . "<br>";
         $_categoria->update();
     }
 }
Beispiel #2
0
 public function remove($idConteudo, $idUsuario = '', $deleteFilhos = true)
 {
     if (!$idUsuario) {
         $idUsuario = Zend_Auth::getInstance()->getStorage()->read()->getId();
     }
     $this->setIdConteudo($idConteudo)->setIdUsuario($idUsuario)->delete(null);
     if ($deleteFilhos) {
         $_conteudo = new Cms_DataView_Conteudo_MapperView();
         $_where = new ZendT_Db_Where();
         $_where->addFilter("cms_conteudo.id_conteudo_pai", $this->getIdConteudo(true)->get());
         $_conteudo->findAll($_where, '*');
         while ($_conteudo->fetch()) {
             $this->remove($_conteudo->getId());
         }
     }
 }
Beispiel #3
0
 public function updateParentCorpoUrl()
 {
     if ($this->_currentChave) {
         $_where = new ZendT_Db_Where();
         $_where->addFilter('cms_conteudo.chave', $this->_currentChave);
         $_where->addFilter('cms_conteudo.corpo_url', "", "!NULL");
         $_conteudo = new Cms_DataView_Conteudo_MapperView();
         $_conteudo->findAll($_where, '*');
         while ($_conteudo->fetch()) {
             $_conteudo->update();
         }
     }
 }