fw4/organimmo-rental-api
Composer 安装命令:
composer require fw4/organimmo-rental-api
包简介
PHP library for implementing the Organimmo rental API
关键字:
README 文档
README
PHP client for the Organimmo rental API. For terms of use and API credentials, refer to the official documentation.
Installation
composer require fw4/organimmo-rental-api
Usage
use Organimmo\Rental\Organimmo; $client = new Organimmo('customer-id'); // Retrieve existing access token from storage (getAccessTokenFromDataStore to be implemented) $accessToken = getAccessTokenFromDataStore(); if (empty($accessToken) || $accessToken->hasExpired()) { // Request and store new access token (saveAccessTokenToDataStore to be implemented) $accessToken = $client->requestAccessToken('client-id', 'client-secret', 'username', 'password'); saveAccessTokenToDataStore($accessToken); } else { $client->setAccessToken($accessToken); }
All endpoints are available as methods of the Organimmo class. For more information about available endpoints and response format, refer to the official API documentation.
Retrieving objects by ID
Call get($id) on an endpoint to retrieve a specific object by ID. If no object exists with the provided ID, null is
returned.
$country = $client->countries()->get(1); if (is_null($country)) echo 'Country does not exist' . PHP_EOL; else echo $country->name . PHP_EOL;
Listing objects
Call get() on an endpoint to retrieve a traversable list of objects. Any pagination that's required happens
automatically.
$countries = $client->countries()->get(); foreach ($countries as $country) { echo $country->name . PHP_EOL; }
Some endpoints may themselves provide additional methods for retrieving related objects. These methods usually accept
the ID of the relevant parent object. Like with other endpoints, chain get() on these methods to retrieve a
traversable list of objects.
$rental_unit_id = 1; $photos = $client->rentalUnits()->photos($rental_unit_id)->get();
Related objects in responses
Responses may contain references to related objects. The actual data of these objects is not present in the response by
default, but can easily be retrieved by calling get() on the pointer object.
$city = $client->cities()->get(1); $country = $city->country->get(); echo $country->name . PHP_EOL;
Alternatively, it is possible to use the depth method to pre-fetch related objects. Pass an integer from 1 to 5 to
determine how many levels to pre-fetch.
$city = $client->cities()->depth(1)->get(1); echo $city->country->name . PHP_EOL;
Sorting results
Use the sort('fieldname') method to order results by a specific property.
$countries = $client->countries()->sort('name')->get();
Filtering results by date
Use the from($date) and to($date) methods to filter results by modification or creation date. These methods accept
DateTime objects.
$countries = $client->countries()->from(date_create('2020-01-01'))->to(date_create('2020-06-01'))->get();
License
fw4/organimmo-rental-api is licensed under the MIT License (MIT). Please see LICENSE for more information.
fw4/organimmo-rental-api 适用场景与选型建议
fw4/organimmo-rental-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.11k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「sdk」 「organimmo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fw4/organimmo-rental-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fw4/organimmo-rental-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fw4/organimmo-rental-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
A lightweight plain-PHP framework for database-backed CRUD APIs.
Modern, strongly-typed, PSR-compliant PHP client for the WeFact v2 API.
PHP SDK for the Enconvert file conversion API
支付宝开放平台v3协议文档,支持最新版PHP8+
Merchant-side PHP SDK for YoPay Pay Open API.
统计信息
- 总下载量: 1.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-09