Add EVLKS accessibility field and export mapping

This commit is contained in:
Jürgen Mummert
2026-04-01 11:46:57 +02:00
parent 42a94a2dd9
commit 8a16de3477
5 changed files with 96 additions and 17 deletions
+27 -12
View File
@@ -12,6 +12,7 @@ class ExportEventsCommand extends Command
{
private $connection;
private $soapClientService;
private const BATCH_SIZE = 200;
public function __construct(Connection $connection, SoapClientService $soapClientService)
{
@@ -29,21 +30,35 @@ class ExportEventsCommand extends Command
{
$today = (new \DateTimeImmutable('today'))->getTimestamp();
$stmt = $this->connection->executeQuery(
'SELECT * FROM tl_calendar_events WHERE pid IN (1, 2, 3) AND evlkscalendar != 1 AND (
(endDate IS NOT NULL AND endDate >= ?) OR (endDate IS NULL AND startDate >= ?)
)',
[$today, $today]
);
$exportedIds = [];
$exportCount = 0;
while ($event = $stmt->fetchAssociative()) {
$response = $this->soapClientService->sendEventToSoapAPI($event);
if ($response) {
$exportedIds[] = (string) $event['id'];
$exportCount++;
$lastId = 0;
while (true) {
$rows = $this->connection->executeQuery(
'SELECT * FROM tl_calendar_events
WHERE pid IN (1, 2, 3)
AND evlkscalendar != 1
AND ((endDate IS NOT NULL AND endDate >= ?) OR (endDate IS NULL AND startDate >= ?))
AND id > ?
ORDER BY id ASC
LIMIT ' . self::BATCH_SIZE,
[$today, $today, $lastId]
)->fetchAllAssociative();
if (empty($rows)) {
break;
}
foreach ($rows as $event) {
$response = $this->soapClientService->sendEventToSoapAPI($event);
if ($response) {
$exportedIds[] = (string) $event['id'];
$exportCount++;
}
$lastId = (int) $event['id'];
}
}