HipoteseLegalPeticionamentoRN.php
2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?
/**
* ANATEL
*
* 30/08/2016 - criado por jaqueline.mendes@castgroup.com.br - CAST
*
*/
require_once dirname(__FILE__).'/../../../SEI.php';
class HipoteseLegalPeticionamentoRN extends InfraRN {
public function __construct() {
parent::__construct ();
}
protected function inicializarObjInfraIBanco() {
return BancoSEI::getInstance ();
}
protected function cadastrarControlado($arrObjHipoteseLegalPeticionamento){
try {
// SessaoSEI::getInstance ()->validarAuditarPermissao ('hipotese_legal_nl_acesso_peticionamento_cadastrar', __METHOD__, $arrObjHipoteseLegalPeticionamento);
if(is_array($arrObjHipoteseLegalPeticionamento))
{
$objHipoteseLegalPeticionamentoBD = new HipoteseLegalPeticionamentoBD($this->getObjInfraIBanco());
foreach($arrObjHipoteseLegalPeticionamento as $obj){
$objHipoteseLegalPeticionamentoBD->cadastrar($obj);
}
return true;
}
return false;
} catch ( Exception $e ) {
throw new InfraException ('Erro cadastrando Classificação do Tema e Subtema do Relacionamento Institucional.', $e );
}
}
protected function contarConectado($objHipoteseLegalPeticionamentoDTO) {
try {
$objHipoteseLegalPeticionamentoBD = new HipoteseLegalPeticionamentoBD($this->getObjInfraIBanco());
$ret = $objHipoteseLegalPeticionamentoBD->contar($objHipoteseLegalPeticionamentoDTO);
return $ret;
}catch(Exception $e){
throw new InfraException('Erro contando as Hípoteses Legais.',$e);
}
}
protected function listarConectado($objHipoteseLegalPeticionamentoDTO) {
try {
$objHipoteseLegalPeticionamentoBD = new HipoteseLegalPeticionamentoBD($this->getObjInfraIBanco());
$ret = $objHipoteseLegalPeticionamentoBD->listar($objHipoteseLegalPeticionamentoDTO);
return $ret;
}catch(Exception $e){
throw new InfraException('Erro listando as Hípoteses Legais.',$e);
}
}
protected function listarHipotesesParametrizadasConectado( $arrIdsHipoteses ) {
try {
$objHipoteseLegalBD = new HipoteseLegalBD($this->getObjInfraIBanco());
$objHipoteseLegalDTO = new HipoteseLegalDTO();
$objHipoteseLegalDTO->retTodos();
$objHipoteseLegalDTO->setOrd('Nome', InfraDTO::$TIPO_ORDENACAO_ASC);
$objHipoteseLegalDTO->adicionarCriterio(array('IdHipoteseLegal'),
array(InfraDTO::$OPER_IN),
array($arrIdsHipoteses));
$ret = $objHipoteseLegalBD->listar($objHipoteseLegalDTO);
return $ret;
} catch(Exception $e){
throw new InfraException('Erro listando as Hípoteses Legais.',$e);
}
}
protected function excluirControlado($arrObjHipoteseLegalPeticionamentoDTO){
try {
$objHipoteseLegalPeticionamentoBD = new HipoteseLegalPeticionamentoBD($this->getObjInfraIBanco());
for($i=0;$i<count($arrObjHipoteseLegalPeticionamentoDTO);$i++){
$objHipoteseLegalPeticionamentoBD->excluir($arrObjHipoteseLegalPeticionamentoDTO[$i]);
}
}catch(Exception $e){
throw new InfraException('Erro cadastrando as Hípoteses Legais.',$e);
}
}
}
?>