janiv/shelf

BoardGameGeek API 2.0 Wrapper for PHP

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

This package is not auto-updated.

Last update: 2024-12-16 16:46:16 UTC


README

A PHP Library to work with the Board Game Geek XML API2 through Guzzle and Entities

Example

<?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>';
}