Example #1
0
 /**
  * Checks whether the index switched tracker plugin and reacts accordingly.
  *
  * Used as a helper method in postSave(). Should only be called when the index
  * was enabled before the change and remained so.
  *
  * @param \Drupal\search_api\IndexInterface $original
  *   The previous version of the index.
  */
 protected function reactToTrackerSwitch(IndexInterface $original)
 {
     if ($this->tracker != $original->getTrackerId()) {
         if ($original->hasValidTracker()) {
             $original->stopTracking();
         }
         if ($this->hasValidTracker()) {
             $this->startTracking();
         }
     }
 }