vendor/store.shopware.com/swagenterprisesearchplatform/src/IndexingQuery/BoostingRepositoryDecorator.php line 33

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Swag\EnterpriseSearch\IndexingQuery;
  3. use Shopware\Core\Framework\Api\Context\SalesChannelApiSource;
  4. use Shopware\Core\Framework\Context;
  5. use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
  6. use Swag\EnterpriseSearch\Boosting\BoostingCollection;
  7. use Swag\EnterpriseSearch\Boosting\BoostingRepository;
  8. class BoostingRepositoryDecorator extends BoostingRepository
  9. {
  10.     /**
  11.      * @var BoostingRepository
  12.      */
  13.     private $decorated;
  14.     /**
  15.      * @var IndexingQueryService
  16.      */
  17.     private $indexingQueryService;
  18.     public function __construct(
  19.         BoostingRepository $decorated,
  20.         IndexingQueryService $indexingQueryService
  21.     ) {
  22.         $this->decorated $decorated;
  23.         $this->indexingQueryService $indexingQueryService;
  24.     }
  25.     public function getBoostings(EntityDefinition $definitionContext $contextSalesChannelApiSource $apiSourcestring $streamType): BoostingCollection
  26.     {
  27.         $indexQuery $this->indexingQueryService->getQueries($definition$context);
  28.         if ($indexQuery) {
  29.             return $indexQuery->boostingCollection;
  30.         }
  31.         return $this->decorated->getBoostings($definition$context$apiSource$streamType);
  32.     }
  33. }