public function Get() { $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('GET'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI); return $this->_machine->Send($context); }
public function GetByPagamento() { $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('GET'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI . '?data=' . $this->dto->DataPagamento); return $this->_machine->Send($context); }
public function GetByPeriodo() { $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('GET'); $context->setHost($this->_host); $context->setRequestURI(sprintf('%s/%s/%s', $this->_requestURI, $this->dto->DataInicio, $this->dto->DataFim)); return $this->_machine->Send($context); }
public function Delete($id) { $this->dto->Id = $id; $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('DELETE'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI . '/' . $this->dto->Id); return $this->_machine->Send($context); }
public function GetByTipo($tipo) { $this->dto->Tipo = $tipo; $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('GET'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI . '/' . $this->dto->Tipo); return $this->_machine->Send($context); }
public function Put() { /*if (!$this->isValid($this->dto)) throw new \Exception('Campos obrigatórios não foram informados: '.implode(', ', $this->getError()), 1);*/ $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('PUT'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI . '?Id=' . $this->dto->Id); $this->_requestJson = $this->dto->fields(); $context->setBody($this->_requestJson); return $this->_machine->Send($context); }
public function Delete() { $id = $this->dto->Id; if (empty($id)) { throw new \Exception('Argumento \\"Id\\" é necessario', 1); } $context = new HttpContext(); $context->setHeaders($this->_header); $context->setAuthorization($this->auth); $context->setMethod('DELETE'); $context->setHost($this->_host); $context->setRequestURI($this->_requestURI . '/' . $this->dto->Id); return $this->_machine->Send($context); }