vermi0ffh/divia-totem

A wrapper for the Divia Totem API

1.0.0 2014-07-03 15:55 UTC

This package is auto-updated.

Last update: 2024-04-09 21:44:54 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);
    }
}