feat: re-implement contact form submissions api endpoint for website
This commit is contained in:
1 parent
ab18e5f134
commit
b567b6a840
11 files changed
+182
-10
No files matched your search
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\XmlParser;
|
||||
|
||||
use App\BusProNet\Model\ContactFormResponse;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
class ContactFormResponseParser extends AbstractParser
|
||||
{
|
||||
public function parse(Crawler $node): ContactFormResponse
|
||||
{
|
||||
$addressId = (int) $node->filterXPath('//idadresse')->text();
|
||||
$personId = (int) $node->filterXPath('//idperson')->text();
|
||||
$isNewRecord = $this->getBoolValue($node->filterXPath('//neuanlage'));
|
||||
|
||||
return new ContactFormResponse(
|
||||
addressId: $addressId,
|
||||
personId: $personId,
|
||||
isNewRecord: $isNewRecord,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user