Ejemplo n.º 1
0
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Arena Ladder and Team Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$ladder = $wow->getArenaLadder(array('battlegroup' => 'Cataclysme / Cataclysm', 'teamsize' => '2v2'));
foreach ($ladder as $entry) {
    printf('<h2>#%d %s</h2>', $entry->getRanking(), $entry->getName());
    echo '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
    echo '<tr>';
    echo '<td>Size</td>';
    printf('<td>%s</td>', $entry->getSize());
    echo '</tr><tr>';
    echo '<td>Realm</td>';
    printf('<td>%s</td>', $entry->getRealm());
    echo '</tr><tr>';
    echo '<td>Faction</td>';
    printf('<td>%s</td>', $entry->getFactionLocale());
    echo '</tr><tr>';
    echo '<td>Rating</td>';
    printf('<td>%d</td>', $entry->getRating());