承接 cdburgess/bggapi 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cdburgess/bggapi

最新稳定版本:v0.0.2

Composer 安装命令:

composer require cdburgess/bggapi

包简介

PHP Library - BoardGameGeek XML API2

README 文档

README

GitHub tag GitHub license build Packagist Downloads

This project provides several request classes to interact with the BGG XML API2. Below are examples of how to run each type of request.

Requests

To submit a request to an endpoint on BoardGameGeek, simply create the request resource for the endpoint you desire. For example, if you want to request a specific board game, you create the thing request as follows:

$thing = new Thing();

Once you have the request object, you can set the various parameters for that request by referencing the method of the parameter name. For example, if you want to request the Nemesis (2018) board game, you set the id as follows:

$this->id(167355);

To send the request to the API, simply call send.

$data = $thing->send();

You can also combine this into a single request.

$thing = new Thing();
$data = $thing->id(167355)
    ->send();

There are a number of quests that accept multiple elements. This can be accomplished by passing these ids as an array.

$thing = new Thing();
$data = $thing->id([167355, 167356, 167357])
    ->send();

Data Formats

By default, the request will return a SimpleXMLElement file. There are two other supported formats: array and JSON. You can request these formats by calling their supported to methods.

$thing = new Thing();
$dataArray = $thing->id(167355)
    ->toArray()
    ->send();
$thing = new Thing();
$dataJson = $thing->id(167355)
    ->toJson()
    ->send();

Request Options

$collection = new Collection();
$family = new Family();
$forumList = new ForumList();
$forum = new Forum();
$hot = new Hot();
$plays = new Plays();
$search = new Search();
$thing = new Thing();
$thread = new Thread();
$user = new User();

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-20