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(); } }
public function findCategoria($idCategoria = '', $idCategoriaPai = '', $orderBy = '', $_where = '') { if (!$orderBy) { $orderBy = 'id'; } if (!$_where instanceof ZendT_Db_Where) { $_where = new ZendT_Db_Where(); } if ($idCategoria) { $_where->addFilter("cms_categoria.id", $idCategoria); } if ($idCategoriaPai) { $_where->addFilter("cms_categoria.id_categoria_pai", $idCategoriaPai); } $_where->addFilter("cms_categoria.status", "A"); $_categoria = new Cms_DataView_Categoria_MapperView(); $_categoria->findAll($_where, "*", $orderBy); return $_categoria; }