![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-catalog/Model/Product/AttributeSet/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Product\AttributeSet; /** * Attribute Set Options */ class Options implements \Magento\Framework\Data\OptionSourceInterface { /** * @var array */ protected $options; /** * @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory */ protected $collectionFactory; /** * @var \Magento\Catalog\Model\ResourceModel\Product */ protected $product; /** * @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $collectionFactory * @param \Magento\Catalog\Model\ResourceModel\Product $product */ public function __construct( \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $collectionFactory, \Magento\Catalog\Model\ResourceModel\Product $product ) { $this->collectionFactory = $collectionFactory; $this->product = $product; } /** * @inheritDoc */ public function toOptionArray() { if (null == $this->options) { $this->options = $this->collectionFactory->create() ->setEntityTypeFilter($this->product->getTypeId()) ->toOptionArray(); } return $this->options; } }