You are here

class RebuildIndex in Persistent URL 8

Hierarchy

  • class \Drupal\purl\Event\RebuildIndex implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of RebuildIndex

1 string reference to 'RebuildIndex'
purl.services.yml in ./purl.services.yml
purl.services.yml
1 service uses RebuildIndex
purl.rebuild_index in ./purl.services.yml
Drupal\purl\Event\RebuildIndex

File

src/Event/RebuildIndex.php, line 15

Namespace

Drupal\purl\Event
View source
class RebuildIndex implements EventSubscriberInterface {

  /**
   * @var ModifierIndex
   */
  protected $modifierIndex;
  public function __construct(ModifierIndex $modifierIndex) {
    $this->modifierIndex = $modifierIndex;
  }
  public static function getSubscribedEvents() {
    return array(
      // RequestSubscriber comes in at 50. We need to go before it.
      KernelEvents::REQUEST => array(
        'onRequest',
        51,
      ),
    );
  }
  public function onRequest(GetResponseEvent $event, $eventName, EventDispatcherInterface $dispatcher) {
    $this->modifierIndex
      ->performDueRebuilds();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RebuildIndex::$modifierIndex protected property
RebuildIndex::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
RebuildIndex::onRequest public function
RebuildIndex::__construct public function