icetee/mnb-exchange-rate
Composer 安装命令:
composer require icetee/mnb-exchange-rate
包简介
Minimal SOAP API wrapper for get exchanges rate from MNB
README 文档
README
Load with composer
The simplest solution is to call the package when using a composer. This cli command, install the package.
$ composer require icetee/mnb-exchange-rate
Usage
Create instance:
$exchange_rate = new \Icetee\MNB\ExchangeRate();
Get current exchange entity by currency:
$rate_entity = $exchange_rate->getCurrentExchangeRate('USD');
The properties of RateEntity:
object(Icetee\MNB\RateEntity)#40 (4) {
["date":protected]=>
string(10) "2018-10-24"
["unit":protected]=>
string(1) "1"
["value":protected]=>
string(9) "282,91000"
["currency":protected]=>
string(3) "USD"
}
Get all current exchange entities:
$rate_entity_collection = $exchange_rate->getExchangeRates();
The properties of RateEntityCollection:
object(Icetee\MNB\RateEntityCollection)#4 (1) {
["collection":"Icetee\MNB\RateEntityCollection":private]=>
array(34) {
[0]=>
object(Icetee\MNB\RateEntity)#9 (4) {
["date":protected]=>
string(10) "2018-10-24"
["unit":protected]=>
string(1) "1"
["value":protected]=>
string(9) "200,36000"
["currency":protected]=>
string(3) "AUD"
}
...
}
}
Get filtered exchange entities:
$rate_entity_collection = $exchange_rate->getExchangeRates('1992-11-11', '1992-11-13', 'USD,AUD');
Get filtered units:
$units = $exchange_rate->getCurrencyUnits('USD,AUD');
ExchangeRate functions
| Function name | Parameter | Default | Return |
|---|---|---|---|
| getCurrentExchangeRate | $currency | EUR | RateEntity / Null |
| getCurrentExchangeRates | - | - | RateEntityCollection |
| getCurrencies | - | - | Array |
| getDateInterval | - | - | Object |
| getExchangeRates | (optional) $startDate, $endDate, $currencyNames | - | Array / RateEntityCollection |
| getCurrencyUnits | (optional) $currencyNames | - | Associative Array |
| getInfo | - | - | Object |
RateEntity methods
| Function name | Parameter | Return |
|---|---|---|
| getDate | - | string |
| setDate | $date | RateEntity |
| getUnit | - | int |
| setUnit | $unit | RateEntity |
| getCurrency | - | string |
| setCurrency | $currency | RateEntity |
| getValue | - | float |
| setValue | $value | RateEntity |
RateEntityCollection methods
| Function name | Parameter | Return |
|---|---|---|
| addEntity | RateEntity $entity | - |
| removeEntity | RateEntity $entity | - |
| findEntity | RateEntity $entity | RateEntity |
| findEntityByCurrency | $currency | RateEntity / Null |
| getCollection | - | Array |
Reference
http://www.mnb.hu/arfolyamok
https://www.mnb.hu/letoltes/aktualis-es-a-regebbi-arfolyamok-webszolgaltatasanak-dokumentacioja-1.pdf
icetee/mnb-exchange-rate 适用场景与选型建议
icetee/mnb-exchange-rate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.39k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2018 年 10 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 icetee/mnb-exchange-rate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 icetee/mnb-exchange-rate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-24