Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/class.gPropsRestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ class gPropsRestClient extends bdCoreRestClient{
/**
* constructor
*/
function __construct(){
public function __construct(){
parent :: __construct();
}

/**
* Gets property data
*@param int $pId Property Id
*/
function getProperty($pId=0){
public function getProperty($pId=0){
//run the query
$output = false;
//$result = $this->post("property/michael",array('pId'=>$pId)); //example post - use later for updating
try{
$result = $this->api->get("props/". $sQuery,array(),array('Content-Type'=>'application/json'));
$result = $this->api->get("property/". $pId ,array(),array('Content-Type'=>'application/json'));
$output = json_decode($result->response,true);
echo $result->response; exit;
//echo $result->response; exit;
}
catch(Exception $e){
$this->logApiError($e);
Expand All @@ -50,7 +50,7 @@ function getProperty($pId=0){
* Gets all property data
*@param int $pId Property Id
*/
function getProperties($sQuery=0){
public function getProperties($sQuery=0){
//run the query
//$result = $this->post("property/michael",array('pId'=>$pId)); //example post - use later for updating
$output = false;
Expand All @@ -70,7 +70,7 @@ function getProperties($sQuery=0){
/**
* Gets all branch data
*/
function getBranches(){
public function getBranches(){
//run the query
//$result = $this->post("property/michael",array('pId'=>$pId)); //example post - use later for updating
$output = false;
Expand All @@ -90,7 +90,7 @@ function getBranches(){
* creates a new detail request - this covers viewins, details about properties and general newsletter requests
*@param array $rData Request Data
*/
function newRequest($rData=array()){
public function newRequest($rData=array()){
//run the query
//$result = $this->post("property/michael",array('pId'=>$pId)); //example post - use later for updating
$output = false;
Expand Down
10 changes: 7 additions & 3 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@

//Retrieve Specific Property Data
//Use a valid property ID on your account
$propertyData = $api->getProperty('1');

$id = '1'; // This is the property ID we are going to fetch.

$propertyData = $api->getProperty($id);
echo'Got property data:';
print_r($propertyData);

var_dump($propertyData);

$allProperties = $api->getProperties();
//$allProperties = $api->getProperties('nres=999999');
var_dump($allProperties);


echo"<br/>";
echo '<br/>';
echo count($api->apiErrors) .' Api Errors';
var_dump($api->apiErrors);

Expand Down