Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 1.0.0
# 1.0.1
* Fix dal validation

* # 1.0.0
* Shopware 6.5 compatibility

# 0.3.4
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frosh/mail-platform-archive",
"version": "1.0.0",
"version": "1.0.1",
"description": "Mail Archive",
"type": "shopware-platform-plugin",
"license": "MIT",
Expand Down
28 changes: 28 additions & 0 deletions src/Extension/Checkout/Customer/CustomerExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);

namespace Frosh\MailArchive\Extension\Checkout\Customer;

use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition;
use Shopware\Core\Checkout\Customer\CustomerDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension;
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;

class CustomerExtension extends EntityExtension
{
public function extendFields(FieldCollection $collection): void
{
$collection->add(
new OneToManyAssociationField(
'froshMailArchive',
MailArchiveDefinition::class,
'customerId'
)
);
}

public function getDefinitionClass(): string
{
return CustomerDefinition::class;
}
}
28 changes: 28 additions & 0 deletions src/Extension/System/SalesChannel/SalesChannelExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);

namespace Frosh\MailArchive\Extension\System\SalesChannel;

use Frosh\MailArchive\Content\MailArchive\MailArchiveDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension;
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
use Shopware\Core\System\SalesChannel\SalesChannelDefinition;

class SalesChannelExtension extends EntityExtension
{
public function extendFields(FieldCollection $collection): void
{
$collection->add(
new OneToManyAssociationField(
'froshMailArchive',
MailArchiveDefinition::class,
'salesChannelId'
)
);
}

public function getDefinitionClass(): string
{
return SalesChannelDefinition::class;
}
}
8 changes: 8 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<tag name="shopware.entity.definition" entity="frosh_mail_archive"/>
</service>

<service id="Frosh\MailArchive\Extension\System\SalesChannel\SalesChannelExtension">
<tag name="shopware.entity.extension"/>
</service>

<service id="Frosh\MailArchive\Extension\Checkout\Customer\CustomerExtension">
<tag name="shopware.entity.extension"/>
</service>

<service id="Frosh\MailArchive\Services\MailSender" public="true" decorates="Shopware\Core\Content\Mail\Service\MailSender">
<argument type="service" id="Frosh\MailArchive\Services\MailSender.inner"/>
<argument type="service" id="request_stack"/>
Expand Down