<?php declare(strict_types=1);
/*
* (c) shopware AG <info@shopware.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Swag\CustomizedProducts\Core\Content\Product\SalesChannel;
use Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\AggregationResultCollection;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult;
use Shopware\Core\Framework\DataAbstractionLayer\Search\IdSearchResult;
use Shopware\Core\System\SalesChannel\Entity\SalesChannelRepositoryInterface;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Swag\CustomizedProducts\Migration\Migration1565933910TemplateProduct;
class SalesChannelProductRepositoryDecorator implements SalesChannelRepositoryInterface
{
/**
* @var SalesChannelRepositoryInterface
*/
private $inner;
public function __construct(SalesChannelRepositoryInterface $inner)
{
$this->inner = $inner;
}
public function search(Criteria $criteria, SalesChannelContext $salesChannelContext): EntitySearchResult
{
$criteria->addAssociation(Migration1565933910TemplateProduct::PRODUCT_TEMPLATE_INHERITANCE_COLUMN);
return $this->inner->search($criteria, $salesChannelContext);
}
/*
* Unchanged Methods
*/
public function searchIds(Criteria $criteria, SalesChannelContext $salesChannelContext): IdSearchResult
{
return $this->inner->searchIds($criteria, $salesChannelContext);
}
public function aggregate(Criteria $criteria, SalesChannelContext $salesChannelContext): AggregationResultCollection
{
return $this->inner->aggregate($criteria, $salesChannelContext);
}
}