/**
  * Retrieve connection for write data
  *
  * @return \Magento\Framework\DB\Adapter\AdapterInterface|false
  */
 protected function _getIndexAdapter()
 {
     if (!$this->_newIndexAdapter) {
         return parent::_getIndexAdapter();
     } else {
         return $this->_getConnection('new');
     }
 }
Ejemplo n.º 2
0
 /**
  * Class constructor
  *
  * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
  * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param string $connectionName
  */
 public function __construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, \Magento\Eav\Model\Config $eavConfig, $connectionName = null)
 {
     $this->_eavConfig = $eavConfig;
     parent::__construct($context, $tableStrategy, $connectionName);
 }
Ejemplo n.º 3
0
 /**
  * Return name of table for given $storeId.
  *
  * @param integer $storeId
  * @return string
  */
 public function getMainStoreTable($storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID)
 {
     if (is_string($storeId)) {
         $storeId = intval($storeId);
     }
     if ($storeId) {
         $suffix = sprintf('store_%d', $storeId);
         $table = $this->getTable('catalog_category_flat_' . $suffix);
     } else {
         $table = parent::getMainTable();
     }
     return $table;
 }