![]() 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/Media/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Product\Media; use Magento\Catalog\Api\ProductMediaAttributeManagementInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Catalog\Model\Product; class AttributeManagement implements ProductMediaAttributeManagementInterface { /** * @var \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory */ private $collectionFactory; /** * @var \Magento\Store\Model\StoreManagerInterface */ private $storeManager; /** * @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $collectionFactory * @param StoreManagerInterface $storeManager */ public function __construct( \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $collectionFactory, StoreManagerInterface $storeManager ) { $this->collectionFactory = $collectionFactory; $this->storeManager = $storeManager; } /** * {@inheritdoc} */ public function getList($attributeSetName) { /** @var \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection $collection */ $collection = $this->collectionFactory->create(); $collection->setAttributeSetFilterBySetName($attributeSetName, Product::ENTITY); $collection->setFrontendInputTypeFilter('media_image'); $collection->addStoreLabel($this->storeManager->getStore()->getId()); return $collection->getItems(); } }