Overview

Namespaces

  • PHP
  • vierbergenlars
    • Forage
      • ODM
        • HydrationSettings
      • QueryParser
      • SearchIndex
      • SearchQuery
      • SearchResult
      • Transport

Classes

  • Compiler
  • Token

Exceptions

  • ParseException
  • Overview
  • Namespace
  • Class
  • Tree

Class Compiler

Compiles a string query to an executable query.

Namespace: vierbergenlars\Forage\QueryParser
Located at vierbergenlars/Forage/QueryParser/Compiler.php
Methods summary
public
# __construct( vierbergenlars\Forage\SearchQuery\QueryBuilder $queryBuilder )

Create a new compiler

Create a new compiler

Parameters

$queryBuilder
vierbergenlars\Forage\SearchQuery\QueryBuilder
$queryBuilder The query builder to compile the query on
public vierbergenlars\Forage\QueryParser\Compiler
# setAllowedFieldNames( array $fieldNames )

Sets the allowed field names

Sets the allowed field names

Parameters

$fieldNames
array
$fieldNames

Returns

vierbergenlars\Forage\QueryParser\Compiler
protected boolean
# isAllowedFieldName( string $field )

Checks if a field name is allowed

Checks if a field name is allowed

Parameters

$field
string
$field

Returns

boolean
public vierbergenlars\Forage\QueryParser\Compiler
# setAllowedSearchFields( array $fieldNames )

Sets the allowed search fields

Sets the allowed search fields

Parameters

$fieldNames
array
$fieldNames

Returns

vierbergenlars\Forage\QueryParser\Compiler
protected boolean
# isAllowedSearchField( string $field )

Checks if a search field is allowed

Checks if a search field is allowed

Parameters

$field
string
$field

Returns

boolean
public vierbergenlars\Forage\QueryParser\Compiler
# setAllowedTokens( array $tokens )

Sets the allowed tokens

Sets the allowed tokens

Parameters

$tokens
array
$tokens

Returns

vierbergenlars\Forage\QueryParser\Compiler
protected boolean
# isAllowedToken( vierbergenlars\Forage\QueryParser\Token $token )

Checks if a token is allowed

Checks if a token is allowed

Parameters

$token
vierbergenlars\Forage\QueryParser\Token
$token

Returns

boolean
public vierbergenlars\Forage\QueryParser\Compiler
# compileQuery( string $queryExpr )

Compiles the search query

Compiles the search query

Parameters

$queryExpr
string
$queryExpr

Returns

vierbergenlars\Forage\QueryParser\Compiler

Throws

vierbergenlars\Forage\QueryParser\ParseException
public vierbergenlars\Forage\SearchQuery\QueryBuilder
# getQueryBuilder( )

Gets the query builder

Gets the query builder

Returns

vierbergenlars\Forage\SearchQuery\QueryBuilder
public vierbergenlars\Forage\SearchQuery\Query
# getQuery( )

Gets the query

Gets the query

Returns

vierbergenlars\Forage\SearchQuery\Query
public
# __clone( )
Properties summary
protected vierbergenlars\Forage\SearchQuery\QueryBuilder $queryBuilder
#

The query builder the query gets inserted to

The query builder the query gets inserted to

protected array $allowedSearchFields array()
#

List of fields that are allowed with T_FIELD_SEARCH

List of fields that are allowed with T_FIELD_SEARCH

protected array $allowedFieldNames array()
#

List of fields that are allowed with T_FIELD_NAME

List of fields that are allowed with T_FIELD_NAME

protected array $allowedTokens array()
#

List of tokens that are allowed

List of tokens that are allowed

Forage-PHP-Client API documentation generated by ApiGen 2.8.0