Copied!

CriterionVisitor

CriterionVisitor.php : 16
Abstract

Visits the criterion tree into a Solr query.

Methods

publiccanVisit()

CriterionVisitor.php : 21

CHeck if visitor is applicable to current criterion.

public abstract canVisit(CriterionInterface $criterion) : mixed

Parameters

Name Type Default value Description
$criterion CriterionInterface - -

publicvisit()

CriterionVisitor.php : 26

Map field value to a proper Solr representation.

public abstract visit(CriterionInterface $criterion[, self|null $subVisitor = null ]) : mixed

Parameters

Name Type Default value Description
$criterion CriterionInterface - -
$subVisitor self|null null -

protectedescapeExpressions()

CriterionVisitor.php : 110

Escapes value for use in expressions.

protected escapeExpressions(string $string[, bool $allowWildcard = false ]) : string|null

Parameters

Name Type Default value Description
$string string - -
$allowWildcard bool false

Allow "*" in expression.

Return values

string|null

protectedescapeQuote()

CriterionVisitor.php : 98

Escapes given $string for wrapping inside single or double quotes.

protected escapeQuote(string $string[, bool $doubleQuote = false ]) : string

Does not include quotes in the returned string, this needs to be done by the consumer code.

Parameters

Name Type Default value Description
$string string - -
$doubleQuote bool false -

Return values

string

protectedgetRange()

CriterionVisitor.php : 40

Get Solr range.

protected getRange(string $operator, mixed $start, mixed $end) : string

Start and end are optional, depending on the respective operator. Pass null in this case. The operator may be one of:

  • case Operator::GT:
  • case Operator::GTE:
  • case Operator::LT:
  • case Operator::LTE:
  • case Operator::BETWEEN:

Parameters

Name Type Default value Description
$operator string - -
$start mixed - -
$end mixed - -

Return values

string

protectedtoString()

CriterionVisitor.php : 84

Converts given $value to the appropriate Solr string representation.

protected toString(mixed $value) : string

Parameters

Name Type Default value Description
$value mixed - -

Return values

string