1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace Shopware\Core\Content\LandingPage\Aggregate\LandingPageTranslation; |
4
|
|
|
|
5
|
|
|
use Shopware\Core\Content\LandingPage\LandingPageDefinition; |
6
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\EntityTranslationDefinition; |
7
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\CustomFields; |
8
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\AllowHtml; |
9
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required; |
10
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\JsonField; |
11
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\LongTextField; |
12
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField; |
13
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @internal (flag:FEATURE_NEXT_12032) |
17
|
|
|
*/ |
18
|
|
|
class LandingPageTranslationDefinition extends EntityTranslationDefinition |
19
|
|
|
{ |
20
|
|
|
public const ENTITY_NAME = 'landing_page_translation'; |
21
|
|
|
|
22
|
|
|
public function getEntityName(): string |
23
|
|
|
{ |
24
|
|
|
return self::ENTITY_NAME; |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public function getCollectionClass(): string |
28
|
|
|
{ |
29
|
|
|
return LandingPageTranslationCollection::class; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function getEntityClass(): string |
33
|
|
|
{ |
34
|
|
|
return LandingPageTranslationEntity::class; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function since(): ?string |
38
|
|
|
{ |
39
|
|
|
// May insert correct since-value |
40
|
|
|
return '6.3.5.0'; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function getParentDefinitionClass(): string |
44
|
|
|
{ |
45
|
|
|
return LandingPageDefinition::class; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
protected function defineFields(): FieldCollection |
49
|
|
|
{ |
50
|
|
|
return new FieldCollection([ |
51
|
|
|
(new StringField('name', 'name'))->addFlags(new Required()), |
52
|
|
|
new JsonField('slot_config', 'slotConfig'), |
53
|
|
|
(new LongTextField('meta_title', 'metaTitle'))->addFlags(new AllowHtml()), |
54
|
|
|
(new LongTextField('meta_description', 'metaDescription'))->addFlags(new AllowHtml()), |
55
|
|
|
(new LongTextField('keywords', 'keywords'))->addFlags(new AllowHtml()), |
56
|
|
|
|
57
|
|
|
new CustomFields(), |
58
|
|
|
]); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|