You are here

class RequestBuilder in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder
  2. 8 src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder
  3. 8.2 src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder

Autocomplete request builder.

Hierarchy

  • class \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder extends \Solarium\Core\Query\AbstractRequestBuilder

Expanded class hierarchy of RequestBuilder

File

src/Solarium/Autocomplete/RequestBuilder.php, line 12

Namespace

Drupal\search_api_solr\Solarium\Autocomplete
View source
class RequestBuilder extends AbstractRequestBuilder {

  /**
   * Build request for an autocomplete query.
   *
   * @param \Solarium\Core\Query\AbstractQuery $query
   *   The Solarium query.
   *
   * @return \Solarium\Core\Client\Request
   *   The Solarium request.
   */
  public function build(AbstractQuery $query) : Request {

    /** @var \Drupal\search_api_solr\Solarium\Autocomplete\Query $query */
    $request = parent::build($query);
    foreach ($query
      ->getComponents() as $component) {
      $componentBuilder = $component
        ->getRequestBuilder();
      if ($componentBuilder) {
        $request = $componentBuilder
          ->buildComponent($component, $request);
      }
    }
    return $request;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RequestBuilder::build public function Build request for an autocomplete query.