/** * Retorna o valor antigo do registro antes de realizar a atualização * * @return Cms_Model_PrivCateg_Mapper */ public function getValueOld() { if (!$this->_dataOld instanceof Cms_Model_PrivCateg_Mapper) { $this->_dataOld = new Cms_Model_PrivCateg_Mapper(); $this->_dataOld->setId($this->getId()); $this->_dataOld->retrive(); } return $this->_dataOld; }
public function delete($where = null) { $_categoria = new Cms_DataView_Categoria_MapperView(); $_categoria->populate($this->getData())->findAll(null, '*'); while ($_categoria->fetch()) { $_privCateg = new Cms_Model_PrivCateg_Mapper(); $_privCateg->setIdCategoria($_categoria->getId())->delete(); $_categoria2 = new Cms_DataView_Categoria_MapperView(); if ($_categoria2->newRow()->setIdCategoriaPai($_categoria->getId())->exists()) { $_categoria2->delete(); } } /* $_categoria->newRow()->setId($this->getId())->retrieve(); $idCategoriaPai = $_categoria->getIdCategoriaPai(); $result = parent::delete($where); if ($result) { if ($_categoria->newRow()->setId($idCategoriaPai)->exists()) { $_categoria->delete(); } } return $result; */ return parent::delete($where); }