kamwoz / wubookapi-bundle
帮助处理 wubook.net API 的捆绑包
dev-master
2018-06-03 08:56 UTC
Requires
- php: >=5.4
- phpxmlrpc/phpxmlrpc: 4.0
- symfony/yaml: >=2.3
Requires (Dev)
- sensio/framework-extra-bundle: ~2.1|~3.0
- symfony/symfony: >=2.3
This package is not auto-updated.
Last update: 2024-09-15 22:42:20 UTC
README
注意:捆绑包稳定,但并非 wubook API 文档中提到的每个方法都已实现。(欢迎贡献力量)
WubookAPIBundle 执行对 wubook.net API 的请求,它是 Symfony2 捆绑包。此捆绑包完全负责处理令牌。它将令牌保存在您的缓存目录下,并始终使用它。即使您没有管理令牌,它也会为您获取它(当然,如果您的配置填写正确)
已实现的方法
acquire_token, release_token, is_token_valid, provider_info,
fetch_rooms, room_images, new_reservation, fetch_bookings,
fetch_booking, fetch_rooms_values, cancel_reservation, update_avail,
update_sparse_avail, fetch_new_bookings, new_room, mod_room, del_room,
push_url, mark_bookings, push_activation, push_update_activation, push_update_url
更多即将到来
安装
$ composer require kamwoz/wubookapi-bundle "dev-master"
在 AppKernel.php 中
new Kamwoz\WubookAPIBundle\WubookAPIBundle(),
配置捆绑包(所有字段都是必填项)
# app/config/config.yml wubook_api: client_username: %wubook_api.client_username% client_password: %wubook_api.client_password% provider_key: ~ #ask support for it property_id: ~ #get it from your account
# app/config/parameters.yml parameters: wubook_api.client_username: yourUsername wubook_api.client_password: yourPassword
示例用法(文档即将推出)
//some controller //fetch bookings from last week $dateFrom = new \DateTime("-1 week"); $dateTo = new \DateTime(); $bookingArrays = $this->get('wubook_api.booking_handler')->fetchBookings($dateFrom, $dateTo);
当前可用的服务
wubook_api.booking_handler wubook_api.token_handler wubook_api.room_handler wubook_api.availability_handler