PHP code example of diasfs / platypus-plugin-vista-soft

1. Go to this page and download the library: Download diasfs/platypus-plugin-vista-soft library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

diasfs / platypus-plugin-vista-soft example snippets


	
	/*
		File: application/config/app.php
	*/
	return array(
		...
		"vista" => array(
			"endpoint" => "http://sandbox-rest.vistahost.com.br",
			"api_key" => "c9fdd79584fb8d369a6a579af1a8f681"
		),
		...
	);

	
	use Platypus\Plugin\VistaSoft;
	
	$query = array(
		"showtotal" => 1,
		"pesquisa" => array(
			"fields" => array(
				"Codigo",
				"UF",
				"Cidade",
				"Bairro"
			),
			"paginacao" => {
				"pagina" => 1,
				"quantidade" => 5
			}
		)
	);
	
	try {
		$rows = VistaSoft::exec("imoveis/listar", $query);
		print_r($rows);

		/*
			stdClass Object
			(
				[MF13993] => stdClass Object
					(
						[Codigo] => MF13993
						[UF] => RS
						[Cidade] => Porto Alegre
						[Bairro] => Centro
					)

				[MF13937] => stdClass Object
					(
						[Codigo] => MF13937
						[UF] => RS
						[Cidade] => Porto Alegre
						[Bairro] => Centro
					)

				[MF13004] => stdClass Object
					(
						[Codigo] => MF13004
						[UF] => RS
						[Cidade] => Porto Alegre
						[Bairro] => Floresta
					)

				[MF13362] => stdClass Object
					(
						[Codigo] => MF13362
						[UF] => RS
						[Cidade] => Porto Alegre
						[Bairro] => Floresta
					)

				[MF13731] => stdClass Object
					(
						[Codigo] => MF13731
						[UF] => RS
						[Cidade] => Porto Alegre
						[Bairro] => Floresta
					)

				[total] => 25539
				[paginas] => 5108
				[pagina] => 1
				[quantidade] => 5
			)
		*/
	} catch (\Exception $err) {
		echo $err->getMessage();
	}