/**
  * After save handler
  *
  * @param \Magento\Framework\App\Config\Value $subject
  * @param mixed $result
  *
  * @return mixed
  */
 public function afterSave(\Magento\Framework\App\Config\Value $subject, $result)
 {
     if ($subject->isValueChanged()) {
         $this->_eavIndexerProcessor->markIndexerAsInvalid();
     }
     return $result;
 }
Beispiel #2
0
 /**
  * After import handler
  *
  * @param \Magento\ImportExport\Model\Import $subject
  * @param Object $import
  *
  * @return mixed
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterImportSource(\Magento\ImportExport\Model\Import $subject, $import)
 {
     if (!$this->_indexerEavProcessor->isIndexerScheduled()) {
         $this->_indexerEavProcessor->markIndexerAsInvalid();
     }
     return $import;
 }
Beispiel #3
0
 /**
  * Invalidate EAV indexer if attribute set has indexable attributes changes
  *
  * @param \Magento\Eav\Model\Entity\Attribute\Set $subject
  * @param callable $proceed
  *
  * @return \Magento\Eav\Model\Entity\Attribute\Set
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSave(\Magento\Eav\Model\Entity\Attribute\Set $subject, \Closure $proceed)
 {
     $requiresReindex = false;
     if ($subject->getId()) {
         /** @var \Magento\Eav\Model\Entity\Attribute\Set $originalSet */
         $originalSet = clone $subject;
         $originalSet->initFromSkeleton($subject->getId());
         $originalAttributeCodes = array_flip($this->_attributeFilter->filter($originalSet));
         $subjectAttributeCodes = array_flip($this->_attributeFilter->filter($subject));
         $requiresReindex = (bool) count(array_merge(array_diff_key($subjectAttributeCodes, $originalAttributeCodes), array_diff_key($originalAttributeCodes, $subjectAttributeCodes)));
     }
     $result = $proceed();
     if ($requiresReindex) {
         $this->_indexerEavProcessor->markIndexerAsInvalid();
     }
     return $result;
 }
Beispiel #4
0
 /**
  * Init indexing process after catalog eav attribute delete commit
  *
  * @return $this
  */
 public function afterDeleteCommit()
 {
     parent::afterDeleteCommit();
     if ($this->_isOriginalEnabledInFlat()) {
         $this->_productFlatIndexerProcessor->markIndexerAsInvalid();
     }
     if ($this->_isOriginalIndexable()) {
         $this->_indexerEavProcessor->markIndexerAsInvalid();
     }
     return $this;
 }
Beispiel #5
0
 /**
  * Before save handler
  *
  * @param \Magento\Store\Model\Resource\Store $subject
  * @param \Magento\Framework\Model\AbstractModel $object
  *
  * @return void
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function beforeSave(\Magento\Store\Model\Resource\Store $subject, \Magento\Framework\Model\AbstractModel $object)
 {
     if ((!$object->getId() || $object->dataHasChangedFor('group_id')) && $object->getIsActive()) {
         $this->_indexerEavProcessor->markIndexerAsInvalid();
     }
 }