final class ProcessingResultsEvent in Search API 8
Wraps a processing results event.
Hierarchy
- class \Drupal\search_api\Event\ProcessingResultsEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of ProcessingResultsEvent
2 files declare their use of ProcessingResultsEvent
- EventListener.php in tests/
search_api_test_events/ src/ EventListener.php - Query.php in src/
Query/ Query.php
File
- src/
Event/ ProcessingResultsEvent.php, line 11
Namespace
Drupal\search_api\EventView source
final class ProcessingResultsEvent extends Event {
/**
* The search results.
*
* @var \Drupal\search_api\Query\ResultSetInterface
*/
protected $results;
/**
* Constructs a new class instance.
*
* @param \Drupal\search_api\Query\ResultSetInterface $results
* The search results.
*/
public function __construct(ResultSetInterface $results) {
$this->results = $results;
}
/**
* Retrieves the search results.
*
* @return \Drupal\search_api\Query\ResultSetInterface
* The search results to alter.
*/
public function getResults() {
return $this->results;
}
/**
* Sets the search results.
*
* Usually, just making changes to the existing results object is sufficient,
* and that is the preferred way of changing results. However, in certain
* situations it can make sense to replace the results object with a
* completely new object instead, in which case this method can be used.
*
* It should not be used unless really necessary, though, to avoid unintended
* side effects (in case of modules that assume the results object will stay
* unchanged).
*
* @param \Drupal\search_api\Query\ResultSetInterface $results
* The new search results.
*/
public function setResults(ResultSetInterface $results) {
$this->results = $results;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ProcessingResultsEvent:: |
protected | property | The search results. | |
ProcessingResultsEvent:: |
public | function | Retrieves the search results. | |
ProcessingResultsEvent:: |
public | function | Sets the search results. | |
ProcessingResultsEvent:: |
public | function | Constructs a new class instance. |