Files
myep/src/BusProNet/XmlParser/BookingUpdateParser.php
T

20 lines
578 B
PHP

<?php
namespace App\BusProNet\XmlParser;
use App\BusProNet\Model\BookingUpdate;
use Symfony\Component\DomCrawler\Crawler;
class BookingUpdateParser extends AbstractParser
{
public function parse(Crawler $node): BookingUpdate
{
$bookingUpdate = new BookingUpdate();
$bookingUpdate->valid = 'möglich' === $node->filterXPath('//aenderung')->text();
$bookingUpdate->success = 'erfolgt' === $node->filterXPath('//aenderung')->text();
$bookingUpdate->status = $node->filterXPath('//status')->text();
return $bookingUpdate;
}
}