Exemple #1
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;
 }
Exemple #2
0
 /**
  * Class constructor
  *
  * @param \Magento\Framework\App\Resource $resource
  * @param \Magento\Eav\Model\Config $eavConfig
  */
 public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig)
 {
     $this->_eavConfig = $eavConfig;
     parent::__construct($resource);
 }