jelle-s / thesportsdb
PSR-4 API library for thesportsdb.com
1.1.1
2016-09-23 09:51 UTC
Requires
- php: ^5.6 || ^7.0
- fastnorth/property-mapper: ^0.0.4
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- codacy/coverage: dev-master
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: ^5.5
- psr/log: ^1.0
Suggests
- hendricha/tagpass: Required in combination with symfony/dependency-injection when using the default_bootstrap.php
- symfony/config: Required in combination with symfony/dependency-injection when using the default_bootstrap.php
- symfony/dependency-injection: Allows the use of a dependency injection container with TheSportsDb.
- symfony/yaml: Required in combination with symfony/dependency-injection when using the default_bootstrap.php
This package is auto-updated.
Last update: 2024-10-25 16:21:45 UTC
README
PHP Library to connect to the api of http://thesportsdb.com/
Example code
<?php include_once __DIR__ . '/default_bootstrap.php'; // Get all sports. $sports = $db->getSports(); // Print the first sport. $sport = reset($sports); print_r($sport->raw()); // Get the leagues of this sport (lazy loaded). $leagues = $sport->getLeagues(); // Print the first league. $league = reset($leagues); print_r($league->raw()); // Get the seasons for this league. $seasons = $league->getSeasons(); // Print the first season. $season = reset($seasons); print_r($season->raw()); // Get the events for this league. $events = $season->getEvents(); // Print the first event. $event = reset($events); // Trigger lazy load, the full event object will be loaded when calling $event->raw(). $event->getName(); print_r($event->raw());