Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.18 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.18 KB

Rankings DB

Rankings DB is a PHP library to provide a clean interface to interact with the British Swimming rankings database.

Install

Via Composer:

$ composer require huwcbjones/rankings-db *

Basic Usage

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

$client = new \RankingsDB\RankingsClient($personal_key, $personal_key_id_number);

From a $client object, you can fetch member details and times.

<?php
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

$client = new \RankingsDB\RankingsClient($personal_key, $personal_key_id_number);

// Get a member's details
$member = $client->getMemberDetails($member_id);

// Get their all time PBs
$options = new GetTimesBuilder($member->MemberID());
$times = $client->getTimes($options);

// Get their times from the past year
$options->setFromDate((new DateTime())->sub(new DateInterval("P1Y")));

$times = $client->getTimes($options);

Documentation

See the doc directory for more detailed documentation.

License

rankings-db-php is licensed under the MIT License - see the LICENSE file for details