/** * Get indexer * * @return \Magento\Indexer\Model\IndexerInterface */ public function getIndexer() { if (!$this->_indexer->getId()) { $this->_indexer->load(static::INDEXER_ID); } return $this->_indexer; }
/** * Return own indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getIndexer() { if (!$this->indexer->getId()) { $this->indexer->load(Fulltext::INDEXER_ID); } return $this->indexer; }
/** * Return indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getFlatIndexer() { if (!$this->flatIndexer->getId()) { $this->flatIndexer->load(static::INDEXER_ID); } return $this->flatIndexer; }
/** * Return own indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getIndexer() { if (!$this->indexer->getId()) { $this->indexer->load(\Magento\Catalog\Model\Indexer\Product\Price\Processor::INDEXER_ID); } return $this->indexer; }
/** * Execute materialization on ids entities * * @param int[] $ids * @return void */ public function execute($ids) { $this->indexer->load(self::INDEXER_ID); /** @var Fulltext\Action\Rows $action */ $action = $this->rowsActionFactory->create(); $action->reindex($ids); }
/** * Return own indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getIndexer() { if (!$this->indexer->getId()) { $this->indexer->load(\Magento\Catalog\Model\Indexer\Category\Flat\State::INDEXER_ID); } return $this->indexer; }
protected function setUp() { /** @var \Magento\Indexer\Model\IndexerInterface indexer */ $this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Indexer\\Model\\Indexer'); $this->indexer->load('catalog_category_product'); /** @var \Magento\Catalog\Model\Resource\Product $productResource */ $this->productResource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Catalog\\Model\\Resource\\Product'); }
protected function setUp() { /** @var \Magento\Indexer\Model\IndexerInterface indexer */ $this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Indexer\\Model\\Indexer'); $this->indexer->load('catalogsearch_fulltext'); $this->engine = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\Resource\\Fulltext\\Engine'); $this->resourceFulltext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\Resource\\Fulltext'); $this->fulltext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\Fulltext'); $this->queryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\QueryFactory'); $this->productFirst = $this->getProductBySku('fulltext-1'); $this->productSecond = $this->getProductBySku('fulltext-2'); }
/** * Execute materialization on ids entities * * @param int[] $ids * @return void */ public function execute($ids) { $this->indexer->load(Flat\State::INDEXER_ID); if ($this->indexer->isInvalid()) { return; } /** @var Flat\Action\Rows $action */ $action = $this->rowsActionFactory->create(); if ($this->indexer->isWorking()) { $action->reindex($ids, true); } $action->reindex($ids); }
/** * Process flat enabled mode change * * @return void */ public function processValue() { if ((bool) $this->getValue() != (bool) $this->getOldValue()) { if ((bool) $this->getValue()) { $this->indexerState->loadByIndexer(\Magento\Catalog\Model\Indexer\Category\Flat\State::INDEXER_ID); $this->indexerState->setStatus(\Magento\Indexer\Model\Indexer\State::STATUS_INVALID); $this->indexerState->save(); } else { $this->flatIndexer->load(\Magento\Catalog\Model\Indexer\Category\Flat\State::INDEXER_ID); $this->flatIndexer->setScheduled(false); } } }
protected function setUp() { /** @var \Magento\Indexer\Model\IndexerInterface indexer */ $this->indexer = Bootstrap::getObjectManager()->create('Magento\\Indexer\\Model\\Indexer'); $this->indexer->load('catalogsearch_fulltext'); $this->engine = Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\Resource\\Engine'); $this->resourceFulltext = Bootstrap::getObjectManager()->get('Magento\\CatalogSearch\\Model\\Resource\\Fulltext'); $this->queryFactory = Bootstrap::getObjectManager()->get('Magento\\Search\\Model\\QueryFactory'); $this->productApple = $this->getProductBySku('fulltext-1'); $this->productBanana = $this->getProductBySku('fulltext-2'); $this->productOrange = $this->getProductBySku('fulltext-3'); $this->productPapaya = $this->getProductBySku('fulltext-4'); $this->productCherry = $this->getProductBySku('fulltext-5'); }
/** * Return product category indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getCategoryIndexer() { if (!$this->categoryIndexer->getId()) { $this->categoryIndexer->load(\Magento\Catalog\Model\Indexer\Product\Category::INDEXER_ID); } return $this->categoryIndexer; }
/** * Execute action for single entity or list of entities * * @param int[] $ids * @return $this */ protected function executeAction($ids) { $ids = array_unique($ids); $this->indexer->load(static::INDEXER_ID); /** @var Product\Action\Rows $action */ $action = $this->rowsActionFactory->create(); if ($this->indexer->isWorking()) { $action->execute($ids, true); } $action->execute($ids); return $this; }
/** * Return category product indexer object * * @return \Magento\Indexer\Model\IndexerInterface */ protected function getProductIndexer() { if (!$this->productIndexer->getId()) { $this->productIndexer->load(Indexer\Category\Product::INDEXER_ID); } return $this->productIndexer; }
/** * Process product price scope change * * @return void */ public function processValue() { if ($this->isValueChanged()) { $this->indexer->load(\Magento\Catalog\Model\Indexer\Product\Price\Processor::INDEXER_ID)->invalidate(); } }