2022-01-27 14:14:02 +01:00
|
|
|
<?php
|
|
|
|
|
2023-11-27 10:04:42 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-11-09 10:27:43 +01:00
|
|
|
namespace WerkraumMedia\Events\Domain\Model;
|
2022-01-27 14:14:02 +01:00
|
|
|
|
|
|
|
use TYPO3\CMS\Core\Resource\Folder;
|
|
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;
|
2024-08-20 08:58:31 +02:00
|
|
|
use WerkraumMedia\Events\Domain\Model\Import\Features;
|
2022-01-27 14:14:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Actual request to import.
|
|
|
|
* Includes all configuration specific to a concrete import.
|
|
|
|
*/
|
|
|
|
class Import extends AbstractDomainObject
|
|
|
|
{
|
2023-11-27 10:04:42 +01:00
|
|
|
protected ?int $categoriesPid;
|
|
|
|
|
|
|
|
protected ?int $featuresPid;
|
2022-01-27 14:14:02 +01:00
|
|
|
|
|
|
|
public function __construct(
|
2023-11-27 10:04:42 +01:00
|
|
|
protected Folder $filesFolder,
|
|
|
|
protected int $storagePid,
|
|
|
|
protected string $restExperience,
|
|
|
|
protected string $restSearchQuery = '',
|
2022-01-27 14:14:02 +01:00
|
|
|
int $categoriesPid = 0,
|
2023-11-27 10:04:42 +01:00
|
|
|
protected ?Category $categoryParent = null,
|
2022-07-05 14:08:14 +02:00
|
|
|
int $featuresPid = 0,
|
2023-11-27 10:04:42 +01:00
|
|
|
protected ?Category $featuresParent = null,
|
2024-08-20 08:58:31 +02:00
|
|
|
protected ?Region $region = null,
|
|
|
|
protected int $importFeatures = 0,
|
2022-01-27 14:14:02 +01:00
|
|
|
) {
|
2022-08-03 08:41:54 +02:00
|
|
|
// Do not allow categories on pid 0
|
|
|
|
if ($categoriesPid === 0) {
|
|
|
|
$categoriesPid = null;
|
|
|
|
}
|
2022-01-27 14:14:02 +01:00
|
|
|
$this->categoriesPid = $categoriesPid;
|
|
|
|
|
2022-08-03 08:41:54 +02:00
|
|
|
// Do not allow features on pid 0
|
|
|
|
if ($featuresPid === 0) {
|
|
|
|
$featuresPid = null;
|
|
|
|
}
|
2022-07-05 14:08:14 +02:00
|
|
|
$this->featuresPid = $featuresPid;
|
2022-01-27 14:14:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getStoragePid(): int
|
|
|
|
{
|
|
|
|
return $this->storagePid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFilesFolder(): Folder
|
|
|
|
{
|
|
|
|
return $this->filesFolder;
|
|
|
|
}
|
|
|
|
|
2022-08-03 08:41:54 +02:00
|
|
|
public function getCategoriesPid(): ?int
|
2022-01-27 14:14:02 +01:00
|
|
|
{
|
|
|
|
return $this->categoriesPid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCategoryParent(): ?Category
|
|
|
|
{
|
|
|
|
return $this->categoryParent;
|
|
|
|
}
|
|
|
|
|
2022-08-03 08:41:54 +02:00
|
|
|
public function getFeaturesPid(): ?int
|
2022-07-05 14:08:14 +02:00
|
|
|
{
|
|
|
|
return $this->featuresPid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFeaturesParent(): ?Category
|
|
|
|
{
|
|
|
|
return $this->featuresParent;
|
|
|
|
}
|
|
|
|
|
2022-01-27 14:14:02 +01:00
|
|
|
public function getRegion(): ?Region
|
|
|
|
{
|
|
|
|
return $this->region;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRestExperience(): string
|
|
|
|
{
|
|
|
|
return $this->restExperience;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSearchQuery(): string
|
|
|
|
{
|
|
|
|
return $this->restSearchQuery;
|
|
|
|
}
|
2024-08-20 08:58:31 +02:00
|
|
|
|
|
|
|
public function getFeatures(): Features
|
|
|
|
{
|
|
|
|
return new Features($this->importFeatures);
|
|
|
|
}
|
2022-01-27 14:14:02 +01:00
|
|
|
}
|