2017 © Pedro Peláez
 

library php-club-dataservice

PHP wrapper around the Sportlink Club.Dataservice API

image

pendonl/php-club-dataservice

PHP wrapper around the Sportlink Club.Dataservice API

  • Thursday, October 12, 2017
  • by Pendo
  • Repository
  • 2 Watchers
  • 2 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Sportlink Club.Dataservice

This package contains a PHP wrapper around the Sportlink Club.Dataservice API. It aims to make working with the API a breeze., (*1)

Installation

Install the package using composer:, (*2)

composer require pendonl/php-club-dataservice

Require the vendor/autoload.php file:, (*3)

require 'vendor/autoload.php';

Create an instance of the API using your Sportlink Club.Dataservice Client ID:, (*4)

use \PendoNL\ClubDataservice\Api as KnvbApi;
$api = new KnvbApi('client_id');
Setting the API key later (DI)

You can set the 'api_key' later. So you can use it better with dependency injection. Here's an example:, (*5)

// app/Providers/AppServiceProvider.php

$this->app->bind(\App\Knvb\ApiInterface::class, function() {
    return new \App\Knvb\Api();
});

// Some other class

public function handle(\App\Knvb\ApiInterface $api) {
    $club = $api->setApiKey('your_api_key_here')->getClub();

    ....
}

It al starts by getting the club details., (*6)

$club = $api->getClub()

All properties - similar to the json response provided by the API - are made public, so you are free to use $club->clubnaam for example. Once you get the club details you can proceed by requesting the teams and related entities., (*7)

$teams = $club->getTeams();
foreach($teams as $team) {

    // $team->teamnaam;

    // Get competitions
    $competitions = $team->competitions();

    foreach($competitions as $competition) {

        // $competition->competitienaam;

        // Fixtures
        $competition->fixtures();

        // Results
        $competition->results();

        // Table standings
        $competition->table();

    }

}

Thanks to

Security

If you discover any security related issues, please email joshua@pendo.nl instead of using the issue tracker., (*8)

About Pendo

Pendo is a webdevelopment agency based in Maastricht, Netherlands. If you'd like, you can visit our website., (*9)

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

12/10 2017

dev-master

9999999-dev

PHP wrapper around the Sportlink Club.Dataservice API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua de Gier

12/10 2017

v0.1

0.1.0.0

PHP wrapper around the Sportlink Club.Dataservice API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua de Gier