@@ -217,6 +217,9 @@ |
||
| 217 | 217 | exit; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | + /** |
|
| 221 | + * @return string |
|
| 222 | + */ |
|
| 220 | 223 | public function getProdutosEstoqueMinimoComoHtml($produtos) { |
| 221 | 224 | ob_start(); |
| 222 | 225 | |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(ROOT . DS . 'vendor' . DS . 'autoload.php'); |
|
| 3 | +require_once(ROOT.DS.'vendor'.DS.'autoload.php'); |
|
| 4 | 4 | |
| 5 | 5 | use Dompdf\Dompdf; |
| 6 | 6 | |
| 7 | -class ProdutoController extends AppController{ |
|
| 7 | +class ProdutoController extends AppController { |
|
| 8 | 8 | |
| 9 | 9 | public function listar_cadastros() { |
| 10 | 10 | $this->layout = 'wadmin'; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function listar_cadastros_ajax() { |
| 14 | 14 | $this->layout = 'ajax'; |
| 15 | 15 | |
| 16 | - $aColumns = array( 'sku', 'imagem', 'nome', 'preco', 'estoque' ); |
|
| 16 | + $aColumns = array('sku', 'imagem', 'nome', 'preco', 'estoque'); |
|
| 17 | 17 | |
| 18 | 18 | $conditions = array('conditions' => |
| 19 | 19 | array( |
@@ -24,26 +24,26 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $allProdutos = $this->Produto->find('all', $conditions); |
| 26 | 26 | |
| 27 | - if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' ) |
|
| 27 | + if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') |
|
| 28 | 28 | { |
| 29 | 29 | $conditions['offset'] = $_GET['iDisplayStart']; |
| 30 | 30 | $conditions['limit'] = $_GET['iDisplayLength']; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if ( isset( $_GET['iSortCol_0'] ) ) |
|
| 33 | + if (isset($_GET['iSortCol_0'])) |
|
| 34 | 34 | { |
| 35 | - for ( $i=0 ; $i < intval( $_GET['iSortingCols'] ) ; $i++ ) |
|
| 35 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) |
|
| 36 | 36 | { |
| 37 | - if ( $_GET[ 'bSortable_' . intval($_GET['iSortCol_' . $i]) ] == "true" ) |
|
| 37 | + if ($_GET['bSortable_'.intval($_GET['iSortCol_'.$i])] == "true") |
|
| 38 | 38 | { |
| 39 | - $conditions['order'] = array('Produto.' . $aColumns[intval($_GET['iSortCol_' . $i])] => $_GET['sSortDir_'.$i]); |
|
| 39 | + $conditions['order'] = array('Produto.'.$aColumns[intval($_GET['iSortCol_'.$i])] => $_GET['sSortDir_'.$i]); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if ( isset( $_GET['sSearch'] ) && !empty( $_GET['sSearch'] ) ) |
|
| 44 | + if (isset($_GET['sSearch']) && ! empty($_GET['sSearch'])) |
|
| 45 | 45 | { |
| 46 | - $conditions['conditions']['Produto.nome LIKE '] = '%' . $_GET['sSearch'] . '%'; |
|
| 46 | + $conditions['conditions']['Produto.nome LIKE '] = '%'.$_GET['sSearch'].'%'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $produtos = $this->Produto->find('all', $conditions); |
@@ -55,19 +55,19 @@ discard block |
||
| 55 | 55 | "aaData" => array() |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | - foreach ( $produtos as $i => $produto ) |
|
| 58 | + foreach ($produtos as $i => $produto) |
|
| 59 | 59 | { |
| 60 | 60 | $row = array(); |
| 61 | 61 | |
| 62 | - for ( $i=0 ; $i < count($aColumns) ; $i++ ) |
|
| 62 | + for ($i = 0; $i < count($aColumns); $i++) |
|
| 63 | 63 | { |
| 64 | 64 | $value = $produto['Produto'][$aColumns[$i]]; |
| 65 | 65 | |
| 66 | 66 | if ($aColumns[$i] == "imagem") |
| 67 | 67 | { |
| 68 | - $value = '<img src="/uploads/produto/imagens/' . $produto['Produto'][$aColumns[$i]] . '" width="120" height="120">'; |
|
| 68 | + $value = '<img src="/uploads/produto/imagens/'.$produto['Produto'][$aColumns[$i]].'" width="120" height="120">'; |
|
| 69 | 69 | |
| 70 | - if (!isset($produto['Produto'][$aColumns[$i]]) || empty($produto['Produto'][$aColumns[$i]])) |
|
| 70 | + if ( ! isset($produto['Produto'][$aColumns[$i]]) || empty($produto['Produto'][$aColumns[$i]])) |
|
| 71 | 71 | { |
| 72 | 72 | $value = '<img src="/images/no_image.png" width="120" height="120">'; |
| 73 | 73 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $row[] = $value; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $btEdit = '<a class="btn btn-info" href="/produto/editar_cadastro/' . $produto['Produto']['id'] . '"><i class="fa fa-pencil"></i></a>'; |
|
| 79 | + $btEdit = '<a class="btn btn-info" href="/produto/editar_cadastro/'.$produto['Produto']['id'].'"><i class="fa fa-pencil"></i></a>'; |
|
| 80 | 80 | |
| 81 | 81 | $row[] = $btEdit; |
| 82 | 82 | |
@@ -87,15 +87,15 @@ discard block |
||
| 87 | 87 | exit; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public function listar_cadastros_estoque_minimo(){ |
|
| 90 | + public function listar_cadastros_estoque_minimo() { |
|
| 91 | 91 | $this->layout = 'wadmin'; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function listar_cadastros_estoque_minimo_ajax(){ |
|
| 94 | + public function listar_cadastros_estoque_minimo_ajax() { |
|
| 95 | 95 | |
| 96 | 96 | $this->layout = 'ajax'; |
| 97 | 97 | |
| 98 | - $aColumns = array( 'sku', 'imagem', 'nome', 'preco', 'estoque' ); |
|
| 98 | + $aColumns = array('sku', 'imagem', 'nome', 'preco', 'estoque'); |
|
| 99 | 99 | |
| 100 | 100 | $this->loadModel('Usuario'); |
| 101 | 101 | |
@@ -117,28 +117,28 @@ discard block |
||
| 117 | 117 | ) |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - $allProdutos = $this->Produto->query("select * from produtos where estoque < quantidade_minima and id_usuario = " . $this->instancia . " and ativo = 1"); |
|
| 120 | + $allProdutos = $this->Produto->query("select * from produtos where estoque < quantidade_minima and id_usuario = ".$this->instancia." and ativo = 1"); |
|
| 121 | 121 | |
| 122 | - if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' ) |
|
| 122 | + if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') |
|
| 123 | 123 | { |
| 124 | 124 | $conditions['offset'] = $_GET['iDisplayStart']; |
| 125 | 125 | $conditions['limit'] = $_GET['iDisplayLength']; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - if ( isset( $_GET['iSortCol_0'] ) ) |
|
| 128 | + if (isset($_GET['iSortCol_0'])) |
|
| 129 | 129 | { |
| 130 | - for ( $i=0 ; $i < intval( $_GET['iSortingCols'] ) ; $i++ ) |
|
| 130 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) |
|
| 131 | 131 | { |
| 132 | - if ( $_GET[ 'bSortable_' . intval($_GET['iSortCol_' . $i]) ] == "true" ) |
|
| 132 | + if ($_GET['bSortable_'.intval($_GET['iSortCol_'.$i])] == "true") |
|
| 133 | 133 | { |
| 134 | - $conditions['order'] = array('Produto.' . $aColumns[intval($_GET['iSortCol_' . $i])] => $_GET['sSortDir_'.$i]); |
|
| 134 | + $conditions['order'] = array('Produto.'.$aColumns[intval($_GET['iSortCol_'.$i])] => $_GET['sSortDir_'.$i]); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if ( isset( $_GET['sSearch'] ) && !empty( $_GET['sSearch'] ) ) |
|
| 139 | + if (isset($_GET['sSearch']) && ! empty($_GET['sSearch'])) |
|
| 140 | 140 | { |
| 141 | - $conditions['conditions']['Produto.nome LIKE '] = '%' . $_GET['sSearch'] . '%'; |
|
| 141 | + $conditions['conditions']['Produto.nome LIKE '] = '%'.$_GET['sSearch'].'%'; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | $produtos = $this->Produto->find('all', $conditions); |
@@ -150,19 +150,19 @@ discard block |
||
| 150 | 150 | "aaData" => array() |
| 151 | 151 | ); |
| 152 | 152 | |
| 153 | - foreach ( $produtos as $i => $produto ) |
|
| 153 | + foreach ($produtos as $i => $produto) |
|
| 154 | 154 | { |
| 155 | 155 | $row = array(); |
| 156 | 156 | |
| 157 | - for ( $i=0 ; $i < count($aColumns) ; $i++ ) |
|
| 157 | + for ($i = 0; $i < count($aColumns); $i++) |
|
| 158 | 158 | { |
| 159 | 159 | $value = $produto['Produto'][$aColumns[$i]]; |
| 160 | 160 | |
| 161 | 161 | if ($aColumns[$i] == "imagem") |
| 162 | 162 | { |
| 163 | - $value = '<img src="/uploads/produto/imagens/' . $produto['Produto'][$aColumns[$i]] . '" width="120" height="120">'; |
|
| 163 | + $value = '<img src="/uploads/produto/imagens/'.$produto['Produto'][$aColumns[$i]].'" width="120" height="120">'; |
|
| 164 | 164 | |
| 165 | - if (!isset($produto['Produto'][$aColumns[$i]]) || empty($produto['Produto'][$aColumns[$i]])) |
|
| 165 | + if ( ! isset($produto['Produto'][$aColumns[$i]]) || empty($produto['Produto'][$aColumns[$i]])) |
|
| 166 | 166 | { |
| 167 | 167 | $value = '<img src="/images/no_image.png" width="120" height="120">'; |
| 168 | 168 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | ) |
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | - $produtos = $this->Produto->query("select * from produtos as Produto where estoque < quantidade_minima and id_usuario = " . $this->instancia . " and ativo = 1"); |
|
| 205 | + $produtos = $this->Produto->query("select * from produtos as Produto where estoque < quantidade_minima and id_usuario = ".$this->instancia." and ativo = 1"); |
|
| 206 | 206 | |
| 207 | 207 | $html = $this->getProdutosEstoqueMinimoComoHtml($produtos); |
| 208 | 208 | |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | foreach ($produtos as $i => $produto) { |
| 259 | 259 | $html .= ' <tr>'; |
| 260 | - $html .= ' <td>' . $produto['Produto']['nome'] . '</td>'; |
|
| 261 | - $html .= ' <td>' . $produto['Produto']['estoque'] . '</td>'; |
|
| 262 | - $html .= ' <td>R$ ' . number_format($produto['Produto']['custo'], 2, ',', '.') . '</td>'; |
|
| 260 | + $html .= ' <td>'.$produto['Produto']['nome'].'</td>'; |
|
| 261 | + $html .= ' <td>'.$produto['Produto']['estoque'].'</td>'; |
|
| 262 | + $html .= ' <td>R$ '.number_format($produto['Produto']['custo'], 2, ',', '.').'</td>'; |
|
| 263 | 263 | $html .= ' </tr>'; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $html .= ''; |
| 272 | 272 | $html .= '</body>'; |
| 273 | 273 | $html .= '</html>'; |
| 274 | - echo $html;exit; |
|
| 274 | + echo $html; exit; |
|
| 275 | 275 | return $html; |
| 276 | 276 | } |
| 277 | 277 | |
@@ -291,15 +291,15 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | public function s_adicionar_cadastro() { |
| 294 | - $dados = $this->request->data('dados'); |
|
| 294 | + $dados = $this->request->data('dados'); |
|
| 295 | 295 | |
| 296 | 296 | $variacoes = $this->request->data('variacao'); |
| 297 | 297 | |
| 298 | - $image = $_FILES['imagem']; |
|
| 298 | + $image = $_FILES['imagem']; |
|
| 299 | 299 | |
| 300 | 300 | $retorno = $this->uploadImage($image); |
| 301 | 301 | |
| 302 | - if (!$retorno['status']) |
|
| 302 | + if ( ! $retorno['status']) |
|
| 303 | 303 | $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
| 304 | 304 | |
| 305 | 305 | $dados['imagem'] = $retorno['nome']; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $dados['ativo'] = 1; |
| 308 | 308 | $dados['id_alias'] = $this->id_alias(); |
| 309 | 309 | |
| 310 | - if($this->Produto->save($dados)) { |
|
| 310 | + if ($this->Produto->save($dados)) { |
|
| 311 | 311 | $produto_id = $this->Produto->getLastInsertId(); |
| 312 | 312 | |
| 313 | 313 | require 'VariacaoController.php'; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | $this->loadModel('Variacao'); |
| 333 | 333 | |
| 334 | - $query = array ( |
|
| 334 | + $query = array( |
|
| 335 | 335 | 'joins' => array( |
| 336 | 336 | array( |
| 337 | 337 | 'table' => 'produtos', |
@@ -374,12 +374,12 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | $variacoes = $this->request->data('variacao'); |
| 376 | 376 | |
| 377 | - $image = $_FILES['imagem']; |
|
| 377 | + $image = $_FILES['imagem']; |
|
| 378 | 378 | |
| 379 | - if (!empty($image['name'])) { |
|
| 379 | + if ( ! empty($image['name'])) { |
|
| 380 | 380 | $retorno = $this->uploadImage($image); |
| 381 | 381 | |
| 382 | - if (!$retorno['status']) |
|
| 382 | + if ( ! $retorno['status']) |
|
| 383 | 383 | $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
| 384 | 384 | |
| 385 | 385 | $dados['imagem'] = $retorno['nome']; |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | $objVariacaoController->desativar_variacoes($id); |
| 400 | 400 | $objVariacaoController->s_adicionar_variacao($variacoes, $id, $this->instancia); |
| 401 | 401 | |
| 402 | - $this->Session->setFlash('Produto editado com sucesso!','default','good'); |
|
| 402 | + $this->Session->setFlash('Produto editado com sucesso!', 'default', 'good'); |
|
| 403 | 403 | return $this->redirect('/produto/listar_cadastros'); |
| 404 | 404 | } else { |
| 405 | - $this->Session->setFlash('Ocorreu um erro ao editar o produto!','default','good'); |
|
| 405 | + $this->Session->setFlash('Ocorreu um erro ao editar o produto!', 'default', 'good'); |
|
| 406 | 406 | return $this->redirect('/produto/listar_cadastros'); |
| 407 | 407 | } |
| 408 | 408 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | ) |
| 445 | 445 | ); |
| 446 | 446 | |
| 447 | - if (!$this->validar_estoque($retorno)) { |
|
| 447 | + if ( ! $this->validar_estoque($retorno)) { |
|
| 448 | 448 | return false; |
| 449 | 449 | } |
| 450 | 450 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | if ($user_active[0]['Usuario']['sale_without_stock']) |
| 475 | 475 | return true; |
| 476 | 476 | |
| 477 | - if (empty($produto) && !isset($produto)) { |
|
| 477 | + if (empty($produto) && ! isset($produto)) { |
|
| 478 | 478 | return false; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -486,11 +486,11 @@ discard block |
||
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | public function calcular_preco_produto_venda($preco, $qnt) { |
| 489 | - if (empty($preco) || !isset($preco)) { |
|
| 489 | + if (empty($preco) || ! isset($preco)) { |
|
| 490 | 490 | return false; |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | - if (!is_numeric($qnt)) { |
|
| 493 | + if ( ! is_numeric($qnt)) { |
|
| 494 | 494 | return false; |
| 495 | 495 | } |
| 496 | 496 | |
@@ -501,12 +501,12 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | public function uploadImage(&$image) { |
| 503 | 503 | $type = substr($image['name'], -4); |
| 504 | - $nameImage = uniqid() . md5($image['name']) . $type; |
|
| 505 | - $dir = APP . 'webroot/uploads/produto/imagens/'; |
|
| 504 | + $nameImage = uniqid().md5($image['name']).$type; |
|
| 505 | + $dir = APP.'webroot/uploads/produto/imagens/'; |
|
| 506 | 506 | |
| 507 | - $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
|
| 507 | + $returnUpload = move_uploaded_file($image['tmp_name'], $dir.$nameImage); |
|
| 508 | 508 | |
| 509 | - if (!$returnUpload) |
|
| 509 | + if ( ! $returnUpload) |
|
| 510 | 510 | return array('nome' => null, 'status' => false); |
| 511 | 511 | |
| 512 | 512 | return array('nome' => $nameImage, 'status' => true); |
@@ -532,8 +532,8 @@ discard block |
||
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | public function exportar_excel_exemplo() { |
| 535 | - include(APP . 'Vendor/PHPExcel/PHPExcel.php'); |
|
| 536 | - include(APP . 'Vendor/PHPExcel/PHPExcel/IOFactory.php'); |
|
| 535 | + include(APP.'Vendor/PHPExcel/PHPExcel.php'); |
|
| 536 | + include(APP.'Vendor/PHPExcel/PHPExcel/IOFactory.php'); |
|
| 537 | 537 | |
| 538 | 538 | $objPHPExcel = new PHPExcel(); |
| 539 | 539 | // Definimos o estilo da fonte |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | public function importar_produtos_planilha() { |
| 573 | - if (!isset($_FILES['arquivo']['tmp_name']) && empty($_FILES['arquivo']['tmp_name'])) |
|
| 573 | + if ( ! isset($_FILES['arquivo']['tmp_name']) && empty($_FILES['arquivo']['tmp_name'])) |
|
| 574 | 574 | { |
| 575 | 575 | $this->Session->setFlash("Erro ao subir a planilha, tente novamente."); |
| 576 | 576 | $this->redirect("/produto/listar_cadastros"); |
@@ -578,13 +578,13 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | $typesPermissions = ['application/vnd.ms-excel']; |
| 580 | 580 | |
| 581 | - if (!in_array($_FILES['arquivo']['type'], $typesPermissions)) |
|
| 581 | + if ( ! in_array($_FILES['arquivo']['type'], $typesPermissions)) |
|
| 582 | 582 | { |
| 583 | 583 | $this->Session->setFlash("O arquivo deve ser no formato .xls."); |
| 584 | 584 | $this->redirect("/produto/listar_cadastros"); |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - $caminho = APP . 'webroot/uploads/produto/planilhas/' . uniqid() . '.xls'; |
|
| 587 | + $caminho = APP.'webroot/uploads/produto/planilhas/'.uniqid().'.xls'; |
|
| 588 | 588 | |
| 589 | 589 | $inputFileName = $_FILES['arquivo']['tmp_name']; |
| 590 | 590 | |
@@ -625,17 +625,17 @@ discard block |
||
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | public function processar_planilhas($inputFileName, $usuarioId, $planilhaId) { |
| 628 | - include(APP . 'Vendor/PHPExcel/PHPExcel.php'); |
|
| 629 | - include(APP . 'Vendor/PHPExcel/PHPExcel/IOFactory.php'); |
|
| 628 | + include(APP.'Vendor/PHPExcel/PHPExcel.php'); |
|
| 629 | + include(APP.'Vendor/PHPExcel/PHPExcel/IOFactory.php'); |
|
| 630 | 630 | |
| 631 | 631 | $objPHPExcel = new PHPExcel(); |
| 632 | 632 | |
| 633 | 633 | try { |
| 634 | - $inputFileType = PHPExcel_IOFactory::identify($inputFileName); |
|
| 635 | - $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
|
| 636 | - $objPHPExcel = $objReader->load($inputFileName); |
|
| 637 | - } catch(Exception $e) { |
|
| 638 | - die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); |
|
| 634 | + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); |
|
| 635 | + $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
|
| 636 | + $objPHPExcel = $objReader->load($inputFileName); |
|
| 637 | + } catch (Exception $e) { |
|
| 638 | + die('Error loading file "'.pathinfo($inputFileName, PATHINFO_BASENAME).'": '.$e->getMessage()); |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | $dados = []; |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | |
| 683 | 683 | $errors = $this->processar_lista_produtos($dados); |
| 684 | 684 | |
| 685 | - if (isset($errors) && !empty($errors)) |
|
| 685 | + if (isset($errors) && ! empty($errors)) |
|
| 686 | 686 | { |
| 687 | 687 | $this->QueueProduct->planilhaProcessedIncomplete($planilhaId); |
| 688 | 688 | } |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | ) |
| 709 | 709 | ); |
| 710 | 710 | |
| 711 | - if (isset($existProduto) && !empty($existProduto)) |
|
| 711 | + if (isset($existProduto) && ! empty($existProduto)) |
|
| 712 | 712 | { |
| 713 | 713 | $this->Produto->id = $existProduto[0]['Produto']['id']; |
| 714 | 714 | $this->Produto->save($dado); |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | $this->Produto->create(); |
| 719 | 719 | |
| 720 | - if (!$this->Produto->save($dado)) |
|
| 720 | + if ( ! $this->Produto->save($dado)) |
|
| 721 | 721 | { |
| 722 | 722 | $errors[] = $dado; |
| 723 | 723 | } |