vendor/store.shopware.com/swagenterprisesearchplatform/src/IndexingQuery/IndexingQueryGateway.php line 31

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Swag\EnterpriseSearch\IndexingQuery;
  3. use Swag\EnterpriseSearch\Boosting\BoostingCollection;
  4. use Swag\EnterpriseSearch\Boosting\BoostingEntity;
  5. use Swag\EnterpriseSearch\Relevance\RelevanceBluePrintCollection;
  6. use Swag\EnterpriseSearch\Relevance\RelevanceBluePrintEntity;
  7. class IndexingQueryGateway
  8. {
  9.     public function fromJsonToBoostingCollection(array $boostingJson): BoostingCollection
  10.     {
  11.         $boostingCollection = new BoostingCollection();
  12.         foreach ($boostingJson as $boostingEntry) {
  13.             $boosting = new BoostingEntity();
  14.             $boosting->assign($boostingEntry);
  15.             $boostingCollection->add($boosting);
  16.         }
  17.         return $boostingCollection;
  18.     }
  19.     public function fromJsonToRelevanceCollection(array $relevanceJson): RelevanceBluePrintCollection
  20.     {
  21.         $relevanceCollection = new RelevanceBluePrintCollection();
  22.         foreach ($relevanceJson as $relevanceEntry) {
  23.             $relevance = new RelevanceBluePrintEntity();
  24.             $relevance->assign($relevanceEntry);
  25.             $relevanceCollection->add($relevance);
  26.         }
  27.         return $relevanceCollection;
  28.     }
  29. }