vermi0ffh / divia-totem
A wrapper for the Divia Totem API
1.0.0
2014-07-03 15:55 UTC
Requires
- php: >=5.4.0
- nategood/httpful: 0.2.*
This package is auto-updated.
Last update: 2024-12-09 23:01:21 UTC
README
Divia totem API PHP wrapper
Installation
In composer, add a dependancy :
"require": {
"vermi0ffh/divia-totem": "dev-master"
}
Usage
To retrieve all lines simply do :
$lignes = Totem::listerLignes();
The result is an array of Ligne objects.
To retrieve all stops of a line, do :
$arrets = $ligne->listerArrets();
The result is an array of Arret objects.
You can retrieve the next times a bus/tram will go by a stop with :
$horaires = $arret->getHoraires();
foreach($horaires as $horaire) {
foreach($horaire->passages as $passage) {
var_dump($passage);
}
}