示例#1
0
 /**
  * Retrieve model behavior
  *
  * @return string
  */
 public function getBehavior()
 {
     if (is_null($this->_behavior)) {
         $this->_behavior = $this->_importFactory->create()->getDataSourceModel()->getBehavior();
     }
     return $this->_behavior;
 }
示例#2
0
 /**
  * Retrieve model behavior
  *
  * @return string
  */
 protected function getBehavior()
 {
     if ($this->behavior === null) {
         $this->behavior = $this->importFactory->create()->getDataSourceModel()->getBehavior();
     }
     return $this->behavior;
 }
示例#3
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 array $data
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 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, array $data = [])
 {
     $this->_scopeConfig = $scopeConfig;
     $this->_dataSourceModel = isset($data['data_source_model']) ? $data['data_source_model'] : $importFactory->create()->getDataSourceModel();
     $this->_connection = isset($data['connection']) ? $data['connection'] : $resource->getConnection('write');
     $this->string = $string;
     $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->_maxDataSize = isset($data['max_data_size']) ? $data['max_data_size'] : $resourceHelper->getMaxDataSize();
     $this->_bunchSize = isset($data['bunch_size']) ? $data['bunch_size'] : (static::XML_PATH_BUNCH_SIZE ? (int) $this->_scopeConfig->getValue(static::XML_PATH_BUNCH_SIZE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE) : 0);
 }
 /**
  * @param \Magento\Framework\Stdlib\StringUtils $string
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\ImportExport\Model\ImportFactory $importFactory
  * @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
  * @param \Magento\Framework\App\ResourceConnection $resource
  * @param ProcessingErrorAggregatorInterface $errorAggregator
  * @param array $data
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function __construct(\Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper, ResourceConnection $resource, ProcessingErrorAggregatorInterface $errorAggregator, array $data = [])
 {
     $this->_scopeConfig = $scopeConfig;
     $this->_dataSourceModel = isset($data['data_source_model']) ? $data['data_source_model'] : $importFactory->create()->getDataSourceModel();
     $this->_connection = isset($data['connection']) ? $data['connection'] : $resource->getConnection();
     $this->string = $string;
     $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->_maxDataSize = isset($data['max_data_size']) ? $data['max_data_size'] : $resourceHelper->getMaxDataSize();
     $this->_bunchSize = isset($data['bunch_size']) ? $data['bunch_size'] : (static::XML_PATH_BUNCH_SIZE ? (int) $this->_scopeConfig->getValue(static::XML_PATH_BUNCH_SIZE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE) : 0);
     $this->errorAggregator = $errorAggregator;
     foreach ($this->errorMessageTemplates as $errorCode => $message) {
         $this->getErrorAggregator()->addErrorMessageTemplate($errorCode, $message);
     }
 }