hoi,
Ik wil alle trajecten, en vertarging ophalen waar een storing is. Dus ik heb deze funcitie:
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public function getStoringen($station, $actual = null, $unplanned = null)
{
$result = array();
$xml = $this->cache->getStoringen($station, $actual, $unplanned);
$xml = new SimpleXMLElement($xml);
foreach ($xml->Ongepland->Storing as $xmlOngeplandeStoring)
{
$id = (string)$xmlOngeplandeStoring->id;
$traject = (string)$xmlOngeplandeStoring->Traject;
$reden = (string)$xmlOngeplandeStoring->Reden;
$bericht = (string)$xmlOngeplandeStoring->Bericht;
$datum = Utils::ISO8601Date2UnixTimestamp($xmlOngeplandeStoring->Datum);
$ongeplandeStoring = new OngeplandeStoring($id, $traject, $bericht, $reden, $datum);
$result[] = $ongeplandeStoring;
}
foreach ($xml->Gepland->Storing as $xmlGeplandeStoring)
{
$id = (string)$xmlGeplandeStoring->id;
$traject = (string)$xmlGeplandeStoring->Traject;
$periode = (string)$xmlGeplandeStoring->Periode;
$reden = (string)$xmlGeplandeStoring->Reden;
$advies = (string)$xmlGeplandeStoring->Advies;
$bericht = (string)$xmlGeplandeStoring->Bericht;
$geplandeStoring = new GeplandeStoring($id, $traject, $bericht, $reden, $periode, $advies);
$result[] = $geplandeStoring;
}
return $result;
}
En ze roep ik de functie
$stations = $ns->getStoringen(, true, true);
Alleen hoe moet ik de eruit halen?
$stations->GetAdvies werkt niet?
Ik gebruik deze API: https://github.com/NS-API/PHP-API
Ik wil alle trajecten, en vertarging ophalen waar een storing is. Dus ik heb deze funcitie:
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public function getStoringen($station, $actual = null, $unplanned = null)
{
$result = array();
$xml = $this->cache->getStoringen($station, $actual, $unplanned);
$xml = new SimpleXMLElement($xml);
foreach ($xml->Ongepland->Storing as $xmlOngeplandeStoring)
{
$id = (string)$xmlOngeplandeStoring->id;
$traject = (string)$xmlOngeplandeStoring->Traject;
$reden = (string)$xmlOngeplandeStoring->Reden;
$bericht = (string)$xmlOngeplandeStoring->Bericht;
$datum = Utils::ISO8601Date2UnixTimestamp($xmlOngeplandeStoring->Datum);
$ongeplandeStoring = new OngeplandeStoring($id, $traject, $bericht, $reden, $datum);
$result[] = $ongeplandeStoring;
}
foreach ($xml->Gepland->Storing as $xmlGeplandeStoring)
{
$id = (string)$xmlGeplandeStoring->id;
$traject = (string)$xmlGeplandeStoring->Traject;
$periode = (string)$xmlGeplandeStoring->Periode;
$reden = (string)$xmlGeplandeStoring->Reden;
$advies = (string)$xmlGeplandeStoring->Advies;
$bericht = (string)$xmlGeplandeStoring->Bericht;
$geplandeStoring = new GeplandeStoring($id, $traject, $bericht, $reden, $periode, $advies);
$result[] = $geplandeStoring;
}
return $result;
}
En ze roep ik de functie
$stations = $ns->getStoringen(, true, true);
Alleen hoe moet ik de eruit halen?
$stations->GetAdvies werkt niet?
Ik gebruik deze API: https://github.com/NS-API/PHP-API