propertywindow / client
Client for property window agents
1.0.1
2018-06-29 11:57 UTC
Requires
- php: >=7.1.4
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.3
This package is not auto-updated.
Last update: 2020-08-01 01:11:47 UTC
README
PHP Client for property window agent websites
Installation
Before anything, you need to make sure you have Composer properly setup in your environment.
Go to project root in your console
If you don't have a composer.json in your project yet:
$ composer init
Include this repository
$ composer require propertywindow/client
Setup
Setup client with authentication details
use PropertyWindow\Client;
$propertyWindow = new Client('token');
Usage
- Get property
$property = $propertyWindow->getProperty('id');
$id = $property->getId();
$subType = $property->getSubType()->getName();
$terms = $property->getTerms()->getName();
$street = $property->getStreet();
$houseNumber = $property->getHouseNumber();
$postcode = $property->getPostcode();
$city = $property->getCity();
$country = $property->getCountry();
$price = $property->getPrice();
$showPrice = $property->getTerms()->isShowPrice();
$soldPrice = $property->getSoldPrice();
$lat = $property->getLat();
$lng = $property->getLng();
$online = $property->isOnline();
$archived = $property->isArchived();
- Get properties
$properties = $propertyWindow->getProperties();
foreach ($properties as $property) {
$id = $property->getId();
$subType = $property->getSubType()->getName();
$terms = $property->getTerms()->getName();
$street = $property->getStreet();
$houseNumber = $property->getHouseNumber();
$postcode = $property->getPostcode();
$city = $property->getCity();
$country = $property->getCountry();
$price = $property->getPrice();
$showPrice = $property->getTerms()->isShowPrice();
$soldPrice = $property->getSoldPrice();
$lat = $property->getLat();
$lng = $property->getLng();
$online = $property->isOnline();
$archived = $property->isArchived();
}
- Get type
$type = $propertyWindow->getType('id');
$id = $type->getId();
$type = $type->getName();
- Get types
$types = $propertyWindow->getTypes();
foreach ($types as $type) {
$id = $type->getId();
$type = $type->getName();
}
- Get subtype
$subType = $propertyWindow->getSubType('id');
$id = $subType->getId();
$subType = $subType->getName();
$typeId = $subType->getType()->getId();
$type = $subType->getType()->getName();
- Get subtypes
$subTypes = $propertyWindow->getSubTypes();
foreach ($subTypes as $subType) {
$id = $subType->getId();
$subType = $subType->getName();
$typeId = $subType->getType()->getId();
$type = $subType->getType()->getName();
}
- Get term
$term = $propertyWindow->getTerm('id');
$id = $term->getId();
$type = $term->getName();
$showPrice = $term->isShowPrice();
- Get terms
$terms = $propertyWindow->getTerms();
foreach ($terms as $term) {
$id = $term->getId();
$term = $term->getName();
$showPrice = $term->isShowPrice();
}