|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace Shopware\Core\Checkout\Order\Aggregate\OrderLineItemDownload; |
|
4
|
|
|
|
|
5
|
|
|
use Shopware\Core\Checkout\Order\Aggregate\OrderLineItem\OrderLineItemDefinition; |
|
6
|
|
|
use Shopware\Core\Content\Media\MediaDefinition; |
|
7
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition; |
|
8
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\BoolField; |
|
9
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\CustomFields; |
|
10
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\FkField; |
|
11
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\ApiAware; |
|
12
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\PrimaryKey; |
|
13
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required; |
|
14
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField; |
|
15
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\IntField; |
|
16
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\ManyToOneAssociationField; |
|
17
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\ReferenceVersionField; |
|
18
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\Field\VersionField; |
|
19
|
|
|
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; |
|
20
|
|
|
use Shopware\Core\Framework\Log\Package; |
|
21
|
|
|
|
|
22
|
|
|
#[Package('customer-order')] |
|
23
|
|
|
class OrderLineItemDownloadDefinition extends EntityDefinition |
|
24
|
|
|
{ |
|
25
|
|
|
public const ENTITY_NAME = 'order_line_item_download'; |
|
26
|
|
|
|
|
27
|
|
|
public function getEntityName(): string |
|
28
|
|
|
{ |
|
29
|
|
|
return self::ENTITY_NAME; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
public function getCollectionClass(): string |
|
33
|
|
|
{ |
|
34
|
|
|
return OrderLineItemDownloadCollection::class; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getEntityClass(): string |
|
38
|
|
|
{ |
|
39
|
|
|
return OrderLineItemDownloadEntity::class; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function since(): ?string |
|
43
|
|
|
{ |
|
44
|
|
|
return '6.4.19.0'; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
protected function getParentDefinitionClass(): ?string |
|
48
|
|
|
{ |
|
49
|
|
|
return OrderLineItemDefinition::class; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
protected function defineFields(): FieldCollection |
|
53
|
|
|
{ |
|
54
|
|
|
return new FieldCollection([ |
|
55
|
|
|
(new IdField('id', 'id'))->addFlags(new ApiAware(), new PrimaryKey(), new Required()), |
|
56
|
|
|
(new VersionField())->addFlags(new ApiAware()), |
|
57
|
|
|
|
|
58
|
|
|
(new FkField('order_line_item_id', 'orderLineItemId', OrderLineItemDefinition::class))->addFlags(new ApiAware(), new Required()), |
|
59
|
|
|
(new ReferenceVersionField(OrderLineItemDefinition::class))->addFlags(new ApiAware(), new Required()), |
|
60
|
|
|
|
|
61
|
|
|
(new FkField('media_id', 'mediaId', MediaDefinition::class))->addFlags(new ApiAware(), new Required()), |
|
62
|
|
|
(new IntField('position', 'position'))->addFlags(new ApiAware(), new Required()), |
|
63
|
|
|
(new BoolField('access_granted', 'accessGranted'))->addFlags(new ApiAware(), new Required()), |
|
64
|
|
|
|
|
65
|
|
|
(new ManyToOneAssociationField('orderLineItem', 'order_line_item_id', OrderLineItemDefinition::class, 'id'))->addFlags(new ApiAware()), |
|
66
|
|
|
(new ManyToOneAssociationField('media', 'media_id', MediaDefinition::class, 'id'))->addFlags(new ApiAware()), |
|
67
|
|
|
(new CustomFields())->addFlags(new ApiAware()), |
|
68
|
|
|
]); |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|