/** * Initialize collection select * Redeclared for remove entity_type_id condition * in catalog_product_entity we store just products * * @return $this */ protected function _initSelect() { if ($this->isEnabledFlat()) { $this->getSelect()->from(array(self::MAIN_TABLE_ALIAS => $this->getEntity()->getFlatTableName()), null)->columns(array('status' => new \Zend_Db_Expr(ProductStatus::STATUS_ENABLED))); $this->addAttributeToSelect(array('entity_id', 'type_id', 'attribute_set_id')); if ($this->_catalogProductFlatState->getFlatIndexerHelper()->isAddChildData()) { $this->getSelect()->where('e.is_child=?', 0); $this->addAttributeToSelect(array('child_id', 'is_child')); } } else { $this->getSelect()->from(array(self::MAIN_TABLE_ALIAS => $this->getEntity()->getEntityTable())); } return $this; }
/** * Initialize collection select * Redeclared for remove entity_type_id condition * in catalog_product_entity we store just products * * @return $this */ protected function _initSelect() { if ($this->isEnabledFlat()) { $this->getSelect()->from([self::MAIN_TABLE_ALIAS => $this->getEntity()->getFlatTableName()], null)->columns(['status' => new \Zend_Db_Expr(ProductStatus::STATUS_ENABLED)]); $this->addAttributeToSelect($this->getResource()->getDefaultAttributes()); if ($this->_catalogProductFlatState->getFlatIndexerHelper()->isAddChildData()) { $this->getSelect()->where('e.is_child=?', 0); $this->addAttributeToSelect(['child_id', 'is_child']); } } else { $this->getSelect()->from([self::MAIN_TABLE_ALIAS => $this->getEntity()->getEntityTable()]); } return $this; }
public function testGetIndexer() { $this->assertInstanceOf('\\Magento\\Catalog\\Helper\\Product\\Flat\\Indexer', $this->_model->getFlatIndexerHelper()); }