示例#1
0
文件: Mapper.php 项目: rtsantos/mais
 /**
  * Retorna o valor antigo do registro antes de realizar a atualização
  *
  * @return Auth_Model_Recurso_Mapper
  */
 public function getValueOld()
 {
     if (!$this->_dataOld instanceof Auth_Model_Recurso_Mapper) {
         $this->_dataOld = new Auth_Model_Recurso_Mapper();
         $this->_dataOld->setId($this->getId());
         $this->_dataOld->retrive();
     }
     return $this->_dataOld;
 }
示例#2
0
文件: Mapper.php 项目: rtsantos/mais
 protected function _beforeSave()
 {
     parent::_beforeSave();
     $this->_oldHierarquia = $this->getHierarquia();
     $hirarquia = $this->getNome(true)->toPhp();
     $idPai = $this->getIdRecursoPai(true)->toPhp();
     if ($idPai) {
         $_mapper = new Auth_Model_Recurso_Mapper();
         $_mapper->setId($idPai)->retrieve();
         $hirarquia = $_mapper->getHierarquia(true)->toPhp() . '.' . $hirarquia;
     }
     $this->setHierarquia($hirarquia);
 }