eurolink/property-api-php-client
Composer 安装命令:
composer require eurolink/property-api-php-client
包简介
A PHP library for Eurolink's Property API
README 文档
README
A PHP client for Eurolink's Property API. This library is restricted for usage by approved clients who have been allowed access to the Property API.
Please direct any support enquiries to the Eurolink support desk or email support@eurolink.co.
API documentation is online: https://property-api.readme.io/
Setup
To install this package you need to be using Composer, and be comfortable using PHP namespaces. Run the following command to pull the PHP package into your project’s ‘vendor’ folder.
composer require eurolink/property-api-php-client
Usage
GET Properties
<?php
require 'vendor/autoload.php';
use PropertyAPI\Client;
$client = new Client([
'accessToken' => '~~INSERT_ACCESS_TOKEN~~',
]);
// additional GET parameters can be passed in (see full documentation for details)
$collection = $client->getProperties([
'size' => 5,
]);
// returns total number of properties matching search criteria
var_dump($collection->getTotal());
// returns number of properties returned in this collection
var_dump($collection->getCount());
// returns array of objects
var_dump($collection->getRows());
// returns array of '\PropertyAPI\Property'
var_dump($collection->getParsedRows());
?>
GET Property
<?php
require 'vendor/autoload.php';
use PropertyAPI\Client;
$client = new Client([
'accessToken' => '~~INSERT_ACCESS_TOKEN~~',
]);
// gets property by property ID
$property = $client->getProperty(123456);
// verify that property have successfully been returned
var_dump($property->isValid());
// test request by displaying Property ID (UUID)
var_dump($property->getPropertyID());
?>
Collection Methods
The following methods are available on an instance of \PropertyAPI\Client.
getTotal() - Returns the total number of properties matching the search criteria.
getCount() - Returns the number of properties in response.
getRows() - Get raw array of properties
getParsedRows() - Get array of properties, as instances of the \PropertyAPI\Property class.
getRawResponse() - Get raw JSON response. Useful for debugging.
Property Class Methods
The following methods are available on an instance of \PropertyAPI\Property.
getCompanyID() - Returns the company UUID.
getPropertyID() - Returns the property UUID.
getID() - Returns the unique, numeric Property ID.
getWebStatus() - Returns the online marketing status/availability of the property.
getBrochures() - Returns array of brochures.
getFeatures() - Returns array of features.
getAddress() - Returns array of address lines.
getAddressString() - Returns address as one string, comma separated.
getShortAddress() - Returns property title of short address for advertising.
getEPCImages() - Returns array of EPC images.
getEPCDocuments() - Returns array of EPC documents.
getFeesDescription() - Returns fees.
getFeesURL() - Returns URL to fees information.
getTenure() - Returns tenure information.
getTenureType() - Returns tenure type.
getFloorPlans() - Returns array of floor plans.
getCategory() - Returns category (Sales or Lettings).
isLettings() - Returns true if category is Lettings.
isSales() - Returns true if category is Sales.
getDescription() - Returns property description.
getCharge() - Returns cost of service charge.
isFeatured() - Returns true if property is marked as featured.
getFeaturedDate() - Returns date that property was marked as featured.
getUpdatedDate() - Returns date property data was last updated.
getCriteriaType() - Returns classification of the property type.
getAmount() - Returns property price.
getAvailableFromDate() - Returns date property is available from.
getTown() - Returns town.
getArea() - Returns area.
getSummaryDescription() - Returns summary description.
getRentPeriod() - Returns rent period (eg: per week)
getPropertyType() - Returns property type.
getClassification() - Returns classification.
isCommerical() - Returns true if commercial property.
getOutsideSpace() - Returns information about the outside space.
getParking() - Returns information about the parking.
getFloors() - Returns the number of floors.
getBedrooms() - Returns the number of bedrooms.
getBathrooms() - Returns the number of bathrooms.
getFurnished() - Returns the furnished status.
getSellingState() - Returns the selling state.
getMarketingDescription() - Returns the marketing description.
getMarketingDescriptionHTML() - Returns the marketing description, including HTML.
getNewProperty() - Returns Y/N if property is new.
getKeywords() - Returns keywords.
getGroundRent() - Returns cost of ground rent.
getNewHome() - Returns true if property is new home.
getInsertDate() - Returns date of first property insert.
getURLs() - Returns array of URLs.
getOfficeID() - Returns the associated office UUID.
getOfficeName() - Returns the associated office name.
getOfficePhone() - Returns the associated office phone number.
getOfficeEmail() - Returns the associated office email.
getOfficeManager() - Returns the associated office manager’s name.
getOfficeURL() - Returns the associated office website URL.
getPhotos() - Returns array of photos.
getPostcode() - Returns postcode.
getLocation() - Returns array of latitude and longitude.
getLongitude() - Returns longitude.
getLatitude() - Returns latitude.
getVideoURLs() - Returns array of video URLs.
Other data is available through the use of Magic Methods. For example:
$property->URLs->URL2
Testing this package
Unit tests
Paste your API Access Token into the root .env file. See .env.example.
./vendor/bin/phpunit tests/
Visual tests
Paste your API Access Token into the root .env file. See .env.example.
php example/simple.php
// or
php example/complex.php
eurolink/property-api-php-client 适用场景与选型建议
eurolink/property-api-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27.98k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 04 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「property」 「Eurolink」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 eurolink/property-api-php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eurolink/property-api-php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 eurolink/property-api-php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Utility library for making class that can contain properties
A simple package to integrate SagePay/Opayo Form v3.00 into your website.
Provides property information based on class documentation
EstateManager for Contao - Manage real estate properties in Contao.
PSR-11 Container for Dependency Injection (auto-wiring, attributes, factories, closures, array access)
estao Contao Immobilienlösung für Hausverwalter und Wohnungsunternehmen
统计信息
- 总下载量: 27.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-16