You are here

interface ResultInterface in Facets 8

The interface defining what a facet result should look like.

Hierarchy

Expanded class hierarchy of ResultInterface

All classes that implement ResultInterface

7 files declare their use of ResultInterface
ArrayWidget.php in src/Plugin/facets/widget/ArrayWidget.php
QueryStringCreated.php in src/Event/QueryStringCreated.php
QueryStringTest.php in tests/src/Unit/Plugin/url_processor/QueryStringTest.php
SearchApiDateTest.php in tests/src/Kernel/Plugin/query_type/SearchApiDateTest.php
SearchApiGranularTest.php in tests/src/Unit/Plugin/query_type/SearchApiGranularTest.php

... See full list

File

src/Result/ResultInterface.php, line 10

Namespace

Drupal\facets\Result
View source
interface ResultInterface {

  /**
   * Returns the facet related to the result.
   *
   * @return \Drupal\facets\FacetInterface
   *   The facet related to the result.
   */
  public function getFacet();

  /**
   * Returns the raw value as present in the index.
   *
   * @return string
   *   The raw value of the result.
   */
  public function getRawValue();

  /**
   * Returns the display value as present in the index.
   *
   * @return string
   *   The formatted value of the result.
   */
  public function getDisplayValue();

  /**
   * Returns the count for the result.
   *
   * @return int
   *   The amount of items for the result.
   */
  public function getCount();

  /**
   * Sets the count for the result.
   *
   * @param int $count
   *   The amount of items for the result.
   */
  public function setCount($count);

  /**
   * Returns the url.
   *
   * @return \Drupal\Core\Url
   *   The url of the search page with the facet url appended.
   */
  public function getUrl();

  /**
   * Sets the url.
   *
   * @param \Drupal\Core\Url $url
   *   The url of the search page with the facet url appended.
   */
  public function setUrl(Url $url);

  /**
   * Indicates that the value is active (selected).
   *
   * @param bool $active
   *   A boolean indicating the active state.
   */
  public function setActiveState($active);

  /**
   * Returns true if the value is active (selected).
   *
   * @return bool
   *   A boolean indicating the active state.
   */
  public function isActive();

  /**
   * Returns true if the value has active children(selected).
   *
   * @return bool
   *   A boolean indicating the active state of children.
   */
  public function hasActiveChildren();

  /**
   * Overrides the display value of a result.
   *
   * @param string $display_value
   *   Override display value.
   */
  public function setDisplayValue($display_value);

  /**
   * Sets children results.
   *
   * @param \Drupal\facets\Result\ResultInterface[] $children
   *   The children to be added.
   */
  public function setChildren(array $children);

  /**
   * Returns children results.
   *
   * @return \Drupal\facets\Result\ResultInterface[]
   *   The children results.
   */
  public function getChildren();

}

Members

Namesort descending Modifiers Type Description Overrides
ResultInterface::getChildren public function Returns children results. 1
ResultInterface::getCount public function Returns the count for the result. 1
ResultInterface::getDisplayValue public function Returns the display value as present in the index. 1
ResultInterface::getFacet public function Returns the facet related to the result. 1
ResultInterface::getRawValue public function Returns the raw value as present in the index. 1
ResultInterface::getUrl public function Returns the url. 1
ResultInterface::hasActiveChildren public function Returns true if the value has active children(selected). 1
ResultInterface::isActive public function Returns true if the value is active (selected). 1
ResultInterface::setActiveState public function Indicates that the value is active (selected). 1
ResultInterface::setChildren public function Sets children results. 1
ResultInterface::setCount public function Sets the count for the result. 1
ResultInterface::setDisplayValue public function Overrides the display value of a result. 1
ResultInterface::setUrl public function Sets the url. 1