Skip to content

Commit b77796b

Browse files
Merge pull request #95 from Shape-and-Shift/esd-4.0.0
Compatible with 6.7
2 parents 9c2109e + 815e9a8 commit b77796b

File tree

107 files changed

+16180
-1007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+16180
-1007
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: true
7171
matrix:
72-
shopware: [ '6.6.0.0' ]
72+
shopware: [ '6.7.0.0-rc4' ]
7373
steps:
7474
- name: Clone Code
7575
uses: actions/checkout@v3
@@ -100,7 +100,7 @@ jobs:
100100
strategy:
101101
fail-fast: true
102102
matrix:
103-
shopware: [ '6.6.0.0' ]
103+
shopware: [ '6.7.0.0-rc4' ]
104104
steps:
105105
- name: Clone Code
106106
uses: actions/checkout@v3

.phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
parameters:
22
level: 8
33
inferPrivatePropertyTypeFromConstructor: true
4-
checkMissingIterableValueType: false
54
reportUnmatchedIgnoredErrors: false
6-
checkGenericClassInNonGenericObjectType: false
75
paths:
86
- ./src
97
excludePaths:

CHANGELOG_de-DE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 4.0.0
2+
- Shopware 6.7 Kompatibilität
3+
14
# 3.0.2
25
* Problem mit dem freien ESD-Element behoben.
36

CHANGELOG_en-GB.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 4.0.0
2+
- Shopware 6.7 compatibility
3+
14
# 3.0.2
25
* Fixed issue that regarding the free ESD item
36

composer.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description":"ESD / Download plugin",
44
"type":"shopware-platform-plugin",
55
"keywords": ["esd", "download"],
6-
"version":"3.0.2",
6+
"version":"4.0.0",
77
"license":"proprietary",
88
"authors":[
99
{
@@ -12,20 +12,21 @@
1212
"homepage":"https://shapeandshift.dev"
1313
}
1414
],
15+
"minimum-stability": "dev",
1516
"require": {
16-
"shopware/core": "~6.6.0",
17-
"shopware/storefront": "~6.6.0",
18-
"shopware/administration": "~6.6.0"
17+
"shopware/core": "~6.7.0",
18+
"shopware/administration": "~6.7.0",
19+
"shopware/storefront": "~6.7.0"
1920
},
2021
"require-dev":{
21-
"phpunit/phpunit": "^10.4",
22-
"phpstan/phpstan": "1.10.60",
23-
"phpcompatibility/php-compatibility": "^9.3",
24-
"squizlabs/php_codesniffer": "^3.6",
25-
"infection/infection": "^0.28.0",
26-
"kubawerlos/php-cs-fixer-custom-fixers": "^v3.21.0",
27-
"symplify/easy-coding-standard": "^12.1.14",
28-
"friendsofphp/php-cs-fixer": "^v3.52.1"
22+
"phpunit/phpunit": "^10.4",
23+
"phpstan/phpstan": "^1.11.10",
24+
"phpcompatibility/php-compatibility": "^9.3",
25+
"squizlabs/php_codesniffer": "^3.6",
26+
"infection/infection": "^0.28.0",
27+
"kubawerlos/php-cs-fixer-custom-fixers": "^v3.21.0",
28+
"symplify/easy-coding-standard": "^12.1.14",
29+
"friendsofphp/php-cs-fixer": "^v3.52.1"
2930
},
3031
"autoload":{
3132
"psr-4":{

src/Checkout/Cart/Subscriber/OrderPlacedSubscriber.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Shopware\Core\Checkout\Cart\Event\CheckoutOrderPlacedEvent;
1515
use Shopware\Core\Checkout\Order\Aggregate\OrderLineItem\OrderLineItemEntity;
1616
use Shopware\Core\Content\Product\ProductCollection;
17-
use Shopware\Core\Content\Product\ProductEntity;
1817
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
1918
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
2019
use Shopware\Core\System\SystemConfig\SystemConfigService;
@@ -23,6 +22,9 @@
2322

2423
class OrderPlacedSubscriber implements EventSubscriberInterface
2524
{
25+
/**
26+
* @param EntityRepository<ProductCollection> $productRepository
27+
*/
2628
public function __construct(
2729
private readonly EntityRepository $productRepository,
2830
private readonly EsdOrderService $esdOrderService,
@@ -31,6 +33,9 @@ public function __construct(
3133
) {
3234
}
3335

36+
/**
37+
* @return array<string, string>
38+
*/
3439
public static function getSubscribedEvents(): array
3540
{
3641
return [
@@ -57,11 +62,9 @@ public function handle(CheckoutOrderPlacedEvent $event): void
5762
$criteria = new Criteria($productIds);
5863
$criteria->addAssociation('esd.esdMedia');
5964

60-
/** @var ProductCollection $products */
6165
$products = $this->productRepository->search($criteria, $event->getContext())->getEntities();
6266

6367
$esdProducts = new ProductCollection();
64-
/** @var ProductEntity $product */
6568
foreach ($products as $product) {
6669
$esd = $product->getExtension('esd');
6770
if (!$esd instanceof EsdEntity) {
@@ -89,7 +92,7 @@ public function handle(CheckoutOrderPlacedEvent $event): void
8992
$templateData = $this->esdOrderService->mailTemplateData($event->getOrder(), $event->getContext());
9093

9194
if (!empty($templateData['esdOrderLineItems'])) {
92-
if ($this->getSystemConfig(EsdMailTemplate::TEMPLATE_DOWNLOAD_DISABLED_ZIP_SYSTEM_CONFIG_NAME)) {
95+
if ($this->getSystemConfig()) {
9396
$event = new EsdDownloadPaymentStatusPaidDisabledZipEvent(
9497
$event->getContext(),
9598
$event->getOrder(),
@@ -109,9 +112,9 @@ public function handle(CheckoutOrderPlacedEvent $event): void
109112
}
110113
}
111114

112-
private function getSystemConfig(string $name): bool
115+
private function getSystemConfig(): bool
113116
{
114-
$config = $this->systemConfigService->get('SasEsd.config.' . $name);
117+
$config = $this->systemConfigService->get('SasEsd.config.' . EsdMailTemplate::TEMPLATE_DOWNLOAD_DISABLED_ZIP_SYSTEM_CONFIG_NAME);
115118
if (empty($config)) {
116119
return false;
117120
}

src/Content/Product/Extension/Esd/Aggregate/EsdDownloadHistory/EsdDownloadHistoryEntity.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdDownloadHistory;
55

6+
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdOrder\EsdOrderEntity;
67
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
78
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
89

@@ -12,6 +13,18 @@ class EsdDownloadHistoryEntity extends Entity
1213

1314
protected ?string $esdOrderId = null;
1415

16+
protected ?EsdOrderEntity $esdOrder = null;
17+
18+
public function getEsdOrder(): ?EsdOrderEntity
19+
{
20+
return $this->esdOrder;
21+
}
22+
23+
public function setEsdOrder(?EsdOrderEntity $esdOrder): void
24+
{
25+
$this->esdOrder = $esdOrder;
26+
}
27+
1528
public function getId(): string
1629
{
1730
return $this->id;

src/Content/Product/Extension/Esd/Aggregate/EsdMedia/EsdMediaEntity.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdMedia;
55

6+
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdVideo\EsdVideoDefinition;
7+
use Sas\Esd\Content\Product\Extension\Esd\EsdDefinition;
68
use Shopware\Core\Content\Media\MediaEntity;
79
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
810
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
@@ -17,6 +19,30 @@ class EsdMediaEntity extends Entity
1719

1820
protected ?MediaEntity $media = null;
1921

22+
protected ?EsdDefinition $esd = null;
23+
24+
protected ?EsdVideoDefinition $esdVideo = null;
25+
26+
public function getEsd(): ?EsdDefinition
27+
{
28+
return $this->esd;
29+
}
30+
31+
public function setEsd(?EsdDefinition $esd): void
32+
{
33+
$this->esd = $esd;
34+
}
35+
36+
public function getEsdVideo(): ?EsdVideoDefinition
37+
{
38+
return $this->esdVideo;
39+
}
40+
41+
public function setEsdVideo(?EsdVideoDefinition $esdVideo): void
42+
{
43+
$this->esdVideo = $esdVideo;
44+
}
45+
2046
protected ?int $downloadLimitNumber = null;
2147

2248
public function getId(): string

src/Content/Product/Extension/Esd/Aggregate/EsdVideo/EsdVideoEntity.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdVideo;
55

6+
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdMedia\EsdMediaEntity;
67
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
78
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
89

@@ -14,6 +15,18 @@ class EsdVideoEntity extends Entity
1415

1516
protected int $option;
1617

18+
protected ?EsdMediaEntity $esdMedia = null;
19+
20+
public function getEsdMedia(): ?EsdMediaEntity
21+
{
22+
return $this->esdMedia;
23+
}
24+
25+
public function setEsdMedia(?EsdMediaEntity $esdMedia): void
26+
{
27+
$this->esdMedia = $esdMedia;
28+
}
29+
1730
public function getEsdMediaId(): string
1831
{
1932
return $this->esdMediaId;

src/Content/Product/Extension/Esd/EsdEntity.php

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Sas\Esd\Content\Product\Extension\Esd;
55

66
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdMedia\EsdMediaCollection;
7+
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdOrder\EsdOrderCollection;
78
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdSerial\EsdSerialCollection;
89
use Shopware\Core\Content\Media\MediaEntity;
910
use Shopware\Core\Content\Product\ProductEntity;
@@ -14,10 +15,7 @@ class EsdEntity extends Entity
1415
{
1516
use EntityIdTrait;
1617

17-
/**
18-
* @var string
19-
*/
20-
protected $id;
18+
protected string $id;
2119

2220
protected string $productId;
2321

@@ -31,6 +29,30 @@ class EsdEntity extends Entity
3129

3230
protected ?EsdMediaCollection $esdMedia = null;
3331

32+
protected ?EsdOrderCollection $orders = null;
33+
34+
protected string $productVersionId;
35+
36+
public function getOrders(): ?EsdOrderCollection
37+
{
38+
return $this->orders;
39+
}
40+
41+
public function setOrders(?EsdOrderCollection $orders): void
42+
{
43+
$this->orders = $orders;
44+
}
45+
46+
public function getProductVersionId(): string
47+
{
48+
return $this->productVersionId;
49+
}
50+
51+
public function setProductVersionId(string $productVersionId): void
52+
{
53+
$this->productVersionId = $productVersionId;
54+
}
55+
3456
protected ?bool $hasCustomDownloadLimit = null;
3557

3658
protected ?bool $hasUnlimitedDownload = null;
@@ -69,7 +91,7 @@ public function setProduct(?ProductEntity $product): void
6991
$this->product = $product;
7092
}
7193

72-
public function hasSerial(): bool
94+
public function isHasSerial(): bool
7395
{
7496
return $this->hasSerial;
7597
}

0 commit comments

Comments
 (0)