Skip to content

Instantly share code, notes, and snippets.

View gersonfs's full-sized avatar

Gerson Felipe Schwinn gersonfs

View GitHub Profile
<?php
namespace App\Test\TestCase\Dominio\ObjetoValor;
use App\Dominio\ObjetoValor\PeriodoMensal;
use Cake\TestSuite\TestCase;
/**
* Class PeriodoMensalTest
*
@gersonfs
gersonfs / PeriodoMensal.php
Created March 24, 2022 14:39
DTO PeriodoMensal
<?php
namespace App\Dominio\ObjetoValor;
class PeriodoMensal
{
private int $mes;
private int $ano;
private string $separador;
<?php
public function remover_produto($id, $condicional_id){
$this->Condicional->CondicionalProduto->id = $id;
if (!$this->Condicional->CondicionalProduto->exists()) {
throw new NotFoundException(__('Invalid condicional'));
}
if (Parametro::v('ATUALIZAR_ESTOQUE_POR_CONDICIONAL', false)) {
$atualizou = $this->Condicional->CondicionalProduto->field('atualizou_estoque');
@gersonfs
gersonfs / gist:38ed2a317a573161fd6f
Last active August 29, 2015 14:24
Upload de arquivos com AJAX
$.ajax({
url: 'paginaDestino.php',
type: 'POST',
data: new FormData($('#FormId')[0]),
processData: false,
contentType: false,
success: function (res) {
//deu certo
},
error: function () {