You are here

final class ItemsIndexedEvent in Search API 8

Wraps an items indexed event.

Hierarchy

  • class \Drupal\search_api\Event\ItemsIndexedEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of ItemsIndexedEvent

2 files declare their use of ItemsIndexedEvent
EventListener.php in tests/search_api_test_events/src/EventListener.php
Index.php in src/Entity/Index.php

File

src/Event/ItemsIndexedEvent.php, line 11

Namespace

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

  /**
   * The index that indexed the items.
   *
   * @var \Drupal\search_api\IndexInterface
   */
  protected $index;

  /**
   * The processed IDs.
   *
   * @var array
   */
  protected $processedIds;

  /**
   * Constructs a new class instance.
   *
   * @param \Drupal\search_api\IndexInterface $index
   *   The index that indexed the items.
   * @param int[] $processedIds
   *   The processed IDs.
   */
  public function __construct(IndexInterface $index, array $processedIds) {
    $this->index = $index;
    $this->processedIds = $processedIds;
  }

  /**
   * Retrieves the index that indexed the items.
   *
   * @return \Drupal\search_api\IndexInterface
   *   The used index.
   */
  public function getIndex() {
    return $this->index;
  }

  /**
   * Retrieves the processed IDs.
   *
   * @return int[]
   *   An array containing the successfully indexed items' IDs.
   */
  public function getProcessedIds() {
    return $this->processedIds;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ItemsIndexedEvent::$index protected property The index that indexed the items.
ItemsIndexedEvent::$processedIds protected property The processed IDs.
ItemsIndexedEvent::getIndex public function Retrieves the index that indexed the items.
ItemsIndexedEvent::getProcessedIds public function Retrieves the processed IDs.
ItemsIndexedEvent::__construct public function Constructs a new class instance.