publicParseSearchExpression example

/** * Sets up and parses the search query. * * @param string $input * The search keywords entered by the user. */
  protected function queryParseSearchExpression($input) {
    if (!isset($this->searchQuery)) {
      $this->searchQuery = \Drupal::service('database.replica')->select('search_index', 'i')->extend(ViewsSearchQuery::class);
      $this->searchQuery->searchExpression($input$this->searchType);
      $this->searchQuery->publicParseSearchExpression();
    }
  }

  /** * {@inheritdoc} */
  public function query($group_by = FALSE) {
    $required = FALSE;
    $this->queryParseSearchExpression($this->argument);
    if (!isset($this->searchQuery)) {
      $required = TRUE;
    }
/** * Sets up and parses the search query. * * @param string $input * The search keywords entered by the user. */
  protected function queryParseSearchExpression($input) {
    if (!isset($this->searchQuery)) {
      $this->parsed = TRUE;
      $this->searchQuery = \Drupal::service('database.replica')->select('search_index', 'i')->extend(ViewsSearchQuery::class);
      $this->searchQuery->searchExpression($input$this->searchType);
      $this->searchQuery->publicParseSearchExpression();
    }
  }

  /** * {@inheritdoc} */
  public function query() {
    // Since attachment views don't validate the exposed input, parse the search     // expression if required.     if (!$this->parsed) {
      $this->queryParseSearchExpression($this->value);
    }
Home | Imprint | This part of the site doesn't use cookies.