diff --git a/src/Domain/Channel/ArticleTypePlatformConfig.php b/src/Domain/Channel/ArticleTypePlatformConfig.php new file mode 100644 index 0000000..e5d209a --- /dev/null +++ b/src/Domain/Channel/ArticleTypePlatformConfig.php @@ -0,0 +1,54 @@ + */ + #[ORM\OneToMany(mappedBy: 'platformConfig', targetEntity: AttributeMapping::class, cascade: ['persist', 'remove'])] + private Collection $attributeMappings; + + public function __construct(ArticleType $articleType, Platform $platform, string $categoryId) + { + $this->id = Uuid::v7(); + $this->articleType = $articleType; + $this->platform = $platform; + $this->categoryId = $categoryId; + $this->attributeMappings = new ArrayCollection(); + } + + public function getId(): Uuid { return $this->id; } + public function getArticleType(): ArticleType { return $this->articleType; } + public function getPlatform(): Platform { return $this->platform; } + public function getCategoryId(): string { return $this->categoryId; } + public function setCategoryId(string $categoryId): void { $this->categoryId = $categoryId; } + + /** @return Collection */ + public function getAttributeMappings(): Collection { return $this->attributeMappings; } +} diff --git a/src/Domain/Channel/AttributeMapping.php b/src/Domain/Channel/AttributeMapping.php new file mode 100644 index 0000000..b5e96a9 --- /dev/null +++ b/src/Domain/Channel/AttributeMapping.php @@ -0,0 +1,52 @@ +id = Uuid::v7(); + $this->platformConfig = $platformConfig; + $this->attributeDefinition = $attributeDefinition; + $this->channelField = $channelField; + } + + public function getId(): Uuid { return $this->id; } + public function getPlatformConfig(): ArticleTypePlatformConfig { return $this->platformConfig; } + public function getAttributeDefinition(): AttributeDefinition { return $this->attributeDefinition; } + public function getChannelField(): ChannelField { return $this->channelField; } + public function getTransformer(): ?string { return $this->transformer; } + public function setTransformer(?string $transformer): void { $this->transformer = $transformer; } +} diff --git a/src/Domain/Channel/ChannelField.php b/src/Domain/Channel/ChannelField.php new file mode 100644 index 0000000..d7e9b1a --- /dev/null +++ b/src/Domain/Channel/ChannelField.php @@ -0,0 +1,42 @@ +id = Uuid::v7(); + $this->platform = $platform; + $this->label = $label; + $this->path = $path; + } + + public function getId(): Uuid { return $this->id; } + public function getPlatform(): Platform { return $this->platform; } + public function getLabel(): string { return $this->label; } + public function setLabel(string $label): void { $this->label = $label; } + public function getPath(): string { return $this->path; } + public function setPath(string $path): void { $this->path = $path; } +} diff --git a/src/Domain/Channel/Platform.php b/src/Domain/Channel/Platform.php new file mode 100644 index 0000000..a44708c --- /dev/null +++ b/src/Domain/Channel/Platform.php @@ -0,0 +1,45 @@ + */ + #[ORM\Column(type: 'json')] + private array $config = []; + + public function __construct(string $type, string $label) + { + $this->id = Uuid::v7(); + $this->type = $type; + $this->label = $label; + } + + public function getId(): Uuid { return $this->id; } + public function getType(): string { return $this->type; } + public function getLabel(): string { return $this->label; } + public function setLabel(string $label): void { $this->label = $label; } + + /** @return array */ + public function getConfig(): array { return $this->config; } + + /** @param array $config */ + public function setConfig(array $config): void { $this->config = $config; } +}