Beispiel #1
0
 public function listarPorPerfileModulo(\model\perfil\Perfil $objPerfil, \model\modulo\Modulo $objModulo)
 {
     $v = $this->_getValidacao();
     $v->setRules($objPerfil->getId(), 'required', 'ID PERFIL');
     $v->setRules($objModulo->getId(), 'required', 'ID MODULO');
     $v->validar();
     return $this->_getRepositorio()->listarPorPerfileModulo($objPerfil, $objModulo);
 }
Beispiel #2
0
 public function listarPorPerfileModulo(\model\perfil\Perfil $objPerfil, \model\modulo\Modulo $objModulo)
 {
     try {
         $arrRetorno = new \ArrayObject();
         $this->_stat = $this->_getConn()->prepare('SELECT * FROM  tblacao WHERE perf_id = :perf_id AND mod_id = :mod_id');
         $this->_stat->bindValue(':perf_id', $objPerfil->getId(), \PDO::PARAM_INT);
         $this->_stat->bindValue(':mod_id', $objModulo->getId(), \PDO::PARAM_INT);
         $this->_stat->execute();
         while ($res = $this->_stat->fetch(\PDO::FETCH_ASSOC)) {
             $arrRetorno->append($this->_getAcao($res));
         }
         return $arrRetorno;
     } catch (\PDOException $e) {
         throw new \model\conexao\Excecao($e->getMessage());
     }
 }