ticketbureau/yii2-seatwave-api
最新稳定版本:v1.4
Composer 安装命令:
composer require ticketbureau/yii2-seatwave-api
包简介
Yii 2 Seatwave API extension. http://www.yiiframework.com
关键字:
README 文档
README
This project is meant to be a easy way to connect with Seatwave API. All information about their API can be found at http://developer.seatwave.com/Api/Api/discovery.
Create a configuration in main.php with the following values
'components' => [ ... 'api' => [ 'class' => 'ticketbureau\seatwave\Connection', 'endpoint' => 'http://api-sandbox.seatwave.com/v2/discovery/', ], ... ],
Here you have a sample model for Categories from Seatwave
<?php namespace seatwave\models; use Yii; use ticketbureau\seatwave\ActiveRecord; use ticketbureau\seatwave\ActiveDataProvider; class Category extends ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'Categories'; } public static function primaryKey() { return ['Id']; } public function attributes() { return [ 'Id', 'Name', 'GenreId', ]; } public static function additionalParams() { return ['apiKey' => '4739E4694D0E482A92C9D0B478D83934']; //Public key api found http://developer.seatwave.com/API/method/GetCategories?apiName=discovery } /** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Category::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); return $dataProvider; } }
统计信息
- 总下载量: 279
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-08-14