events/Classes/Service/DestinationDataImportService/UrlFactory.php
Daniel Siepmann (Codappix) a07c16b723
Migrate TypoScript import settings
Those are now part of the import, or hard coded.

Resolves: #11483
2024-11-04 14:30:18 +01:00

37 lines
1,001 B
PHP

<?php
declare(strict_types=1);
namespace WerkraumMedia\Events\Service\DestinationDataImportService;
use TYPO3\CMS\Core\Http\Uri;
use WerkraumMedia\Events\Domain\Model\Import;
/**
* Factory to create URLs used during import of Destination Data.
*/
final class UrlFactory
{
/**
* URL used to fetch initial set of data.
*/
public function createSearchResultUrl(
Import $import
): string {
$parameter = [
'experience' => $import->getRestExperience(),
'licensekey' => $import->getRestLicenseKey(),
'type' => 'Event',
'mode' => $import->getRestMode(),
'limit' => $import->getRestLimit(),
'template' => 'ET2014A.json',
'q' => $import->getRestSearchQuery(),
];
$parameter = array_filter($parameter);
$url = new Uri('http://meta.et4.de/rest.ashx/search/');
$url = $url->withQuery(http_build_query($parameter));
return (string)$url;
}
}