예제 #1
0
파일: Indexer.php 프로젝트: nja78/magento2
 /**
  * Retrieve Catalog Entity Type Id
  *
  * @return int
  */
 public function getEntityTypeId()
 {
     if ($this->_entityTypeId === null) {
         $this->_entityTypeId = $this->_configFactory->create()->getEntityTypeId();
     }
     return $this->_entityTypeId;
 }
예제 #2
0
 /**
  * Retrieve resource model
  *
  * @return \Koklu\MasterData\Model\Resource\Catalog\Config
  */
 protected function _getResource()
 {
     return $this->_configFactory->create();
 }
예제 #3
0
 /**
  * Joins product name attribute value to use it in WHERE and ORDER clauses
  *
  * @return $this
  */
 protected function _joinProductNameTable()
 {
     if (!$this->_isProductNameJoined) {
         $entityTypeId = $this->_catalogConfFactory->create()->getEntityTypeId();
         /** @var \Magento\Catalog\Model\Entity\Attribute $attribute */
         $attribute = $this->_catalogAttrFactory->create()->loadByCode($entityTypeId, 'name');
         $storeId = $this->_storeManager->getStore()->getId();
         $this->getSelect()->join(array('product_name_table' => $attribute->getBackendTable()), 'product_name_table.entity_id=main_table.product_id' . ' AND product_name_table.store_id=' . $storeId . ' AND product_name_table.attribute_id=' . $attribute->getId() . ' AND product_name_table.entity_type_id=' . $entityTypeId, array());
         $this->_isProductNameJoined = true;
     }
     return $this;
 }