Skip to content

Commit

Permalink
📝 APP #220 primeiro cliente
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Mar 10, 2020
1 parent 475b2e7 commit a18e7b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions appexemplo_v3.0/controllers/Regiao.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ class Regiao


private $dao = null;
private $client = null;

public function __construct($tpdo = null)
{
$this->dao = new RegiaoDAO($tpdo);
$this->client = new GuzzleHttp\Client(['base_uri' => 'http://localhost/formDin/appexemplo_v2.0/api/']);
}
public function getDao()
{
Expand Down Expand Up @@ -48,7 +49,9 @@ public function selectAllPagination( $orderBy=null, $where=null, $page=null, $r
//--------------------------------------------------------------------------------
public function selectAll( $orderBy=null, $where=null )
{
$result = $this->dao->selectAll( $orderBy, $where );
$response = $this->client->request('GET', 'regiao');
$contents = $response->getBody()->getContents();
$result = json_decode($contents);
return $result;
}
//--------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions appexemplo_v3.0/modulos/regiao.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
defined('APLICATIVO') or die();
require_once 'modulos/includes/acesso_view_allowed.php';

$controller = new Regiao();
$result = $controller->selectAll();
var_dump($result);

$primaryKey = 'COD_REGIAO';
$frm = new TForm('Cadastro de Regiões',800,950);
$frm->setShowCloseButton(false);
Expand Down

0 comments on commit a18e7b9

Please sign in to comment.