You are here

final class ReindexScheduledEvent in Search API 8

Wraps a reindex scheduled event.

Hierarchy

Expanded class hierarchy of ReindexScheduledEvent

3 files declare their use of ReindexScheduledEvent
CommandHelper.php in src/Utility/CommandHelper.php
EventListener.php in tests/search_api_test_events/src/EventListener.php
Index.php in src/Entity/Index.php

File

src/Event/ReindexScheduledEvent.php, line 11

Namespace

Drupal\search_api\Event
View source
final class ReindexScheduledEvent extends Event {

  /**
   * The index scheduled for reindexing.
   *
   * @var \Drupal\search_api\IndexInterface
   */
  protected $index;

  /**
   * Boolean indicating whether the index was also cleared.
   *
   * @var bool
   */
  protected $clear;

  /**
   * Constructs a new class instance.
   *
   * @param \Drupal\search_api\IndexInterface $index
   *   The index scheduled for reindexing.
   * @param bool $clear
   *   Boolean indicating whether the index was also cleared.
   */
  public function __construct(IndexInterface $index, $clear) {
    $this->index = $index;
    $this->clear = $clear;
  }

  /**
   * Retrieves the index scheduled for reindexing.
   *
   * @return \Drupal\search_api\IndexInterface
   *   The index scheduled for reindexing.
   */
  public function getIndex() {
    return $this->index;
  }

  /**
   * Retrieves a boolean indicating whether the index was also cleared.
   *
   * @return bool
   *   TRUE if the index was also cleared as part of the reindexing, FALSE
   *   otherwise.
   */
  public function isClear() {
    return $this->clear;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ReindexScheduledEvent::$clear protected property Boolean indicating whether the index was also cleared.
ReindexScheduledEvent::$index protected property The index scheduled for reindexing.
ReindexScheduledEvent::getIndex public function Retrieves the index scheduled for reindexing.
ReindexScheduledEvent::isClear public function Retrieves a boolean indicating whether the index was also cleared.
ReindexScheduledEvent::__construct public function Constructs a new class instance.