events/Classes/Domain/Model/Import.php
Daniel Siepmann 81065f5c67
BREAKING: TYPO3 v12 support (#44)
* Migrated all fixtures to PHP.
* Removed version specific adjustments.
2023-11-27 10:04:42 +01:00

88 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
namespace WerkraumMedia\Events\Domain\Model;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;
/**
* Actual request to import.
* Includes all configuration specific to a concrete import.
*/
class Import extends AbstractDomainObject
{
protected ?int $categoriesPid;
protected ?int $featuresPid;
public function __construct(
protected Folder $filesFolder,
protected int $storagePid,
protected string $restExperience,
protected string $restSearchQuery = '',
int $categoriesPid = 0,
protected ?Category $categoryParent = null,
int $featuresPid = 0,
protected ?Category $featuresParent = null,
protected ?Region $region = null
) {
// Do not allow categories on pid 0
if ($categoriesPid === 0) {
$categoriesPid = null;
}
$this->categoriesPid = $categoriesPid;
// Do not allow features on pid 0
if ($featuresPid === 0) {
$featuresPid = null;
}
$this->featuresPid = $featuresPid;
}
public function getStoragePid(): int
{
return $this->storagePid;
}
public function getFilesFolder(): Folder
{
return $this->filesFolder;
}
public function getCategoriesPid(): ?int
{
return $this->categoriesPid;
}
public function getCategoryParent(): ?Category
{
return $this->categoryParent;
}
public function getFeaturesPid(): ?int
{
return $this->featuresPid;
}
public function getFeaturesParent(): ?Category
{
return $this->featuresParent;
}
public function getRegion(): ?Region
{
return $this->region;
}
public function getRestExperience(): string
{
return $this->restExperience;
}
public function getSearchQuery(): string
{
return $this->restSearchQuery;
}
}