Copied!

CriterionVisitor

CriterionVisitor.php : 15

Visits the criterion tree into a Solr query.

Methods

publiccanVisit()

CriterionVisitor.php : 22

CHeck if visitor is applicable to current criterion.

public abstract canVisit(Criterion $criterion) : bool

Parameters

Name Type Default value Description
$criterion Criterion - -

Return values

bool

publicvisit()

CriterionVisitor.php : 31

Map field value to a proper Solr representation.

public abstract visit(Criterion $criterion[, CriterionVisitor $subVisitor = null ]) : string

Parameters

Name Type Default value Description
$criterion Criterion - -
$subVisitor CriterionVisitor null -

Return values

string

protectedescapeExpressions()

CriterionVisitor.php : 137

Escapes value for use in expressions.

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

Parameters

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

Allow "*" in expression.

protectedescapeQuote()

CriterionVisitor.php : 122

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 : 51

Get Solr range.

protected getRange(mixed $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 mixed - -
$start mixed - -
$end mixed - -

Return values

string

protectedtoString()

CriterionVisitor.php : 99

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