vendor/bitbag/elasticsearch-plugin/src/Context/ProductOptionsContext.php line 35

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file has been created by developers from BitBag.
  4.  * Feel free to contact us once you face any issues or want to start
  5.  * another great project.
  6.  * You can find more information about us on https://bitbag.shop and write us
  7.  * an email on mikolaj.krol@bitbag.pl.
  8.  */
  9. declare(strict_types=1);
  10. namespace BitBag\SyliusElasticsearchPlugin\Context;
  11. use BitBag\SyliusElasticsearchPlugin\Finder\ProductOptionsFinderInterface;
  12. final class ProductOptionsContext implements ProductOptionsContextInterface
  13. {
  14.     /** @var TaxonContextInterface */
  15.     private $taxonContext;
  16.     /** @var ProductOptionsFinderInterface */
  17.     private $optionsFinder;
  18.     public function __construct(
  19.         TaxonContextInterface $taxonContext,
  20.         ProductOptionsFinderInterface $optionsFinder
  21.     ) {
  22.         $this->taxonContext $taxonContext;
  23.         $this->optionsFinder $optionsFinder;
  24.     }
  25.     public function getOptions(): ?array
  26.     {
  27.         $taxon $this->taxonContext->getTaxon();
  28.         $options $this->optionsFinder->findByTaxon($taxon);
  29.         return $options;
  30.     }
  31. }