Skip to content

Traewelling/db-rest-mappings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DB Rest Mappings

This package is a very simple implementation of the datatypes used in https://v5.db.transport.rest/ and the corresponding API.

Warning

This is in very early development. Code might change without notice in the same version. Use at your own risk.

Usage

// get your departure board
$responseJson = $client->get('/stops/8000191/departures', $query); 
$data = json_decode($responseJson, true);

// parse into a DepartureBoard
$hydrator = new \DRM\Hydrator\DbRestHydrator();

foreach ($data as $key => $value) {
    $data[$key] = $hydrator->hydrate($value, \DRM\Dto\Departure::class);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages