Skip to content

Commit 11e7acf

Browse files
fix: dal validation (#44)
1 parent a017045 commit 11e7acf

File tree

5 files changed

+69
-2
lines changed

5 files changed

+69
-2
lines changed

CHANGELOG_en-GB.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# 1.0.0
1+
# 1.0.1
2+
* Fix dal validation
3+
4+
* # 1.0.0
25
* Shopware 6.5 compatibility
36

47
# 0.3.4

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frosh/mail-platform-archive",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Mail Archive",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Frosh\MailArchive\Extension\Checkout\Customer;
4+
5+
use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition;
6+
use Shopware\Core\Checkout\Customer\CustomerDefinition;
7+
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension;
8+
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
9+
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
10+
11+
class CustomerExtension extends EntityExtension
12+
{
13+
public function extendFields(FieldCollection $collection): void
14+
{
15+
$collection->add(
16+
new OneToManyAssociationField(
17+
'froshMailArchive',
18+
MailArchiveDefinition::class,
19+
'customerId'
20+
)
21+
);
22+
}
23+
24+
public function getDefinitionClass(): string
25+
{
26+
return CustomerDefinition::class;
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Frosh\MailArchive\Extension\System\SalesChannel;
4+
5+
use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition;
6+
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension;
7+
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
8+
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
9+
use Shopware\Core\System\SalesChannel\SalesChannelDefinition;
10+
11+
class SalesChannelExtension extends EntityExtension
12+
{
13+
public function extendFields(FieldCollection $collection): void
14+
{
15+
$collection->add(
16+
new OneToManyAssociationField(
17+
'froshMailArchive',
18+
MailArchiveDefinition::class,
19+
'salesChannelId'
20+
)
21+
);
22+
}
23+
24+
public function getDefinitionClass(): string
25+
{
26+
return SalesChannelDefinition::class;
27+
}
28+
}

src/Resources/config/services.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
<tag name="shopware.entity.definition" entity="frosh_mail_archive"/>
1212
</service>
1313

14+
<service id="Frosh\MailArchive\Extension\System\SalesChannel\SalesChannelExtension">
15+
<tag name="shopware.entity.extension"/>
16+
</service>
17+
18+
<service id="Frosh\MailArchive\Extension\Checkout\Customer\CustomerExtension">
19+
<tag name="shopware.entity.extension"/>
20+
</service>
21+
1422
<service id="Frosh\MailArchive\Services\MailSender" public="true" decorates="Shopware\Core\Content\Mail\Service\MailSender">
1523
<argument type="service" id="Frosh\MailArchive\Services\MailSender.inner"/>
1624
<argument type="service" id="request_stack"/>

0 commit comments

Comments
 (0)