OptionProvider.php 820 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\ConfigurableProduct\Model\ResourceModel\Attribute;
  7. use Magento\Framework\EntityManager\MetadataPool;
  8. use Magento\Catalog\Api\Data\ProductInterface;
  9. class OptionProvider
  10. {
  11. /**
  12. * Product metadata pool
  13. *
  14. * @var MetadataPool
  15. */
  16. private $metadataPool;
  17. /**
  18. * @param MetadataPool $metadataPool
  19. */
  20. public function __construct(
  21. MetadataPool $metadataPool
  22. ) {
  23. $this->metadataPool = $metadataPool;
  24. }
  25. /**
  26. * Get product entity link field
  27. *
  28. * @return string
  29. */
  30. public function getProductEntityLinkField()
  31. {
  32. return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
  33. }
  34. }