コード例 #1
0
ファイル: CategoriaValorModel.php プロジェクト: dnaCRM/dnaCRM
 public function getArrayDados()
 {
     $categoria = (new CategoriaDAO())->getById($this->dto->getCdCategoria());
     $desc_categoria = $categoria->getDescCategoria();
     $grupo = '';
     if ($this->dto->getCdGrupo()) {
         $grupoDTO = $this->getDAO()->getById($this->dto->getCdGrupo());
         $grupo = $grupoDTO->getDescVlCatg();
     }
     return array('cd_categoria' => $this->dto->getCdCategoria(), 'desc_categoria' => $desc_categoria, 'cd_vl_categoria' => $this->dto->getCdVlCategoria(), 'desc_vl_categoria' => $this->dto->getDescVlCatg(), 'genero' => $this->dto->getGenero() ? $this->dto->getGenero() : '--', 'grupo' => $grupo, 'cd_grupo' => $this->dto->getCdGrupo(), 'cd_cat_grupo' => $this->dto->getCdCatGrupo());
 }
コード例 #2
0
ファイル: CategoriaValorDAO.php プロジェクト: dnaCRM/dnaCRM
 /**
  * @param CategoriaValorDTO $dto
  * @return bool|DataTransferObject
  * @throws Exception
  */
 public function gravar(CategoriaValorDTO $dto)
 {
     if (!$dto->getCdVlCategoria()) {
         if (!($obj = $this->insert($dto))) {
             throw new Exception('Impossível Gravar Valor');
         }
     } else {
         if (!($obj = $this->update($dto))) {
             throw new Exception('Impossível Atualizar Valor');
         }
     }
     return $obj;
 }