Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigurableOptionsProvider.php
Go to the documentation of this file.
1 <?php
8 
13 use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
15 
17 {
21  private $configurable;
22 
26  private $products;
27 
36  public function __construct(
37  Configurable $configurable,
39  LinkedProductSelectBuilderInterface $linkedProductSelectBuilder,
40  CollectionFactory $collectionFactory,
41  RequestSafetyInterface $requestSafety
42  ) {
43  $this->configurable = $configurable;
44  }
45 
50  {
51  if (!isset($this->products[$product->getId()])) {
52  $this->products[$product->getId()] = $this->configurable->getUsedProducts($product);
53  }
54  return $this->products[$product->getId()];
55  }
56 }
__construct(Configurable $configurable, ResourceConnection $resourceConnection, LinkedProductSelectBuilderInterface $linkedProductSelectBuilder, CollectionFactory $collectionFactory, RequestSafetyInterface $requestSafety)