_init('catalog_category_flat', 'entity_id'); } /** * 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'); } } /** * Change write adapter * * @param bool $newIndexAdapter */ public function newIndexAdapter($newIndexAdapter = true) { $this->_newIndexAdapter = $newIndexAdapter; } }