12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
38
app/Services/Import/ImportContext.php
Normal file
38
app/Services/Import/ImportContext.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Import;
|
||||
|
||||
use App\Enums\Portal;
|
||||
|
||||
/**
|
||||
* Hält den Kontext für einen Import-Lauf.
|
||||
*/
|
||||
final class ImportContext
|
||||
{
|
||||
public readonly ?Portal $portalEnum;
|
||||
|
||||
public readonly ?string $connection;
|
||||
|
||||
public function __construct(
|
||||
public readonly string $portal, // 'presseecho' | 'businessportal24' | 'all'
|
||||
public readonly bool $dryRun = false,
|
||||
public readonly bool $force = false,
|
||||
) {
|
||||
if ($portal === 'all') {
|
||||
$this->portalEnum = null;
|
||||
$this->connection = null;
|
||||
} else {
|
||||
$this->portalEnum = Portal::from($portal);
|
||||
$this->connection = match ($portal) {
|
||||
'presseecho' => 'mysql_presseecho',
|
||||
'businessportal24' => 'mysql_businessportal',
|
||||
default => throw new \InvalidArgumentException("Unbekanntes Portal: {$portal}"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public function legacyPortalValue(): string
|
||||
{
|
||||
return $this->portal;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue