janiv/shelf

PHP的BoardGameGeek API 2.0包装器

v0.2.0 2014-02-17 03:46 UTC

This package is not auto-updated.

Last update: 2024-09-23 15:36:01 UTC


README

一个PHP库,通过Guzzle和Entities与Board Game Geek XML API2交互

示例

<?php

include 'vendor/autoload.php';

$client = Shelf\Client::factory();

// Getting a single game
$response = $client->getBoardgame(
    array('id' => 13)
);
$game = $response->getBoardgame();

echo '<p>' . $game->getPrimaryName()->getValue() . '</p>';


// Getting a collection of games
$response = $client->getBoardgames(
    array('id' => array(12, 13, 34119))
);
$games = $response->getBoardgames();
foreach ($games as $game) {
    echo '<p>' . $game->getPrimaryName()->getValue() . '</p>';
}