Ejemplo n.º 1
0
 /**
  * @param \Magento\Framework\Stdlib\String $string
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\ImportExport\Model\ImportFactory $importFactory
  * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper
  * @param \Magento\Framework\App\Resource $resource
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param array $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function __construct(\Magento\Framework\Stdlib\String $string, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, array $data = [])
 {
     parent::__construct($string, $scopeConfig, $importFactory, $resourceHelper, $resource, $data);
     $this->_storeManager = $storeManager;
     $this->_attributeCollection = isset($data['attribute_collection']) ? $data['attribute_collection'] : $collectionFactory->create(static::ATTRIBUTE_COLLECTION_NAME);
     if (isset($data['entity_type_id'])) {
         $this->_entityTypeId = $data['entity_type_id'];
     } else {
         $this->_entityTypeId = $eavConfig->getEntityType($this->getEntityTypeCode())->getEntityTypeId();
     }
 }
Ejemplo n.º 2
0
 /**
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory
  * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory
  * @param array $data
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, array $data = [])
 {
     $this->_scopeConfig = $scopeConfig;
     $this->_storeManager = $storeManager;
     $this->_attributeCollection = isset($data['attribute_collection']) ? $data['attribute_collection'] : $collectionFactory->create(static::ATTRIBUTE_COLLECTION_NAME);
     $this->_pageSize = isset($data['page_size']) ? $data['page_size'] : (static::XML_PATH_PAGE_SIZE ? (int) $this->_scopeConfig->getValue(static::XML_PATH_PAGE_SIZE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE) : 0);
     $this->_byPagesIterator = isset($data['collection_by_pages_iterator']) ? $data['collection_by_pages_iterator'] : $resourceColFactory->create();
 }