QueryParser

Class for parsing query parameters in backend live search.

Detects searches for #pages:23 or #content:mycontent

Internal

This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.

Table of Contents

Constants

COMMAND_KEY_INDICATOR  = '#'
COMMAND_SPLIT_INDICATOR  = ':'

Properties

$commandKey  : string
$tableName  : string

Methods

getCommandForPageJump()  : string
Gets the page jump command for a given query.
getCommandForTable()  : string
Gets the command for the given table.
getId()  : int
Verify if a given query contains a page jump command.
getSearchQueryValue()  : string
Extract the search value from the full search query which contains also the command part.
getTableNameFromCommand()  : string
Find the registered table command and retrieve the matching table name.
isValidCommand()  : bool
Verify if a given query contains a registered command key.
isValidPageJump()  : bool
Verify if a given query contains a page jump command.
extractKeyFromQuery()  : mixed
Retrieve the validated command key

Constants

COMMAND_KEY_INDICATOR

public string COMMAND_KEY_INDICATOR = '#'

COMMAND_SPLIT_INDICATOR

public string COMMAND_SPLIT_INDICATOR = ':'

Properties

$commandKey

protected string $commandKey = ''

$tableName

protected string $tableName = ''

Methods

getCommandForPageJump()

Gets the page jump command for a given query.

public getCommandForPageJump(string $query) : string
Parameters
$query : string
Return values
string

getCommandForTable()

Gets the command for the given table.

public getCommandForTable(string $tableName) : string
Parameters
$tableName : string

The table to find a command for.

Return values
string

getId()

Verify if a given query contains a page jump command.

public getId(string $query) : int
Parameters
$query : string

A valid value looks like '#14'

Return values
int

getSearchQueryValue()

Extract the search value from the full search query which contains also the command part.

public getSearchQueryValue(string $query) : string
Parameters
$query : string

For example #news:weather

Return values
string

The extracted search value

getTableNameFromCommand()

Find the registered table command and retrieve the matching table name.

public getTableNameFromCommand(string $query) : string
Parameters
$query : string
Return values
string

Database Table name

isValidCommand()

Verify if a given query contains a registered command key.

public isValidCommand(string $query) : bool
Parameters
$query : string
Return values
bool

isValidPageJump()

Verify if a given query contains a page jump command.

public isValidPageJump(string $query) : bool
Parameters
$query : string

A valid value looks like '#14'

Return values
bool

extractKeyFromQuery()

Retrieve the validated command key

protected extractKeyFromQuery(string $query) : mixed
Parameters
$query : string

        
On this page

Search results