TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Search\LiveSearch\QueryParser Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Search\LiveSearch\QueryParser:
t3lib_search_liveSearch_queryParser

Public Member Functions

 getSearchQueryValue ($query)
 
 getTableNameFromCommand ($query)
 
 getId ($query)
 
 isValidPageJump ($query)
 
 isValidCommand ($query)
 
 getCommandForTable ($tableName)
 
 getCommandForPageJump ($query)
 

Public Attributes

const COMMAND_KEY_INDICATOR = '#'
 
const COMMAND_SPLIT_INDICATOR = ':'
 

Protected Member Functions

 extractKeyFromQuery ($query)
 

Protected Attributes

 $commandKey = ''
 
 $tableName = ''
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Class for parsing query parameters in backend live search.

Author
Michael Klapper micha.nosp@m.el.k.nosp@m.lappe.nosp@m.r@ao.nosp@m.emedi.nosp@m.a.de
Jeff Segars jeff@.nosp@m.webe.nosp@m.mpowe.nosp@m.redc.nosp@m.hurch.nosp@m..org

Definition at line 22 of file QueryParser.php.

Member Function Documentation

◆ extractKeyFromQuery()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::extractKeyFromQuery (   $query)
protected

Retrieve the validated command key

Parameters
string$query
Returns
string Command name

Definition at line 48 of file QueryParser.php.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getSearchQueryValue(), and TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getTableNameFromCommand().

◆ getCommandForPageJump()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::getCommandForPageJump (   $query)

◆ getCommandForTable()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::getCommandForTable (   $tableName)

Gets the command for the given table.

Parameters
string$tableNameThe table to find a command for.
Returns
string

Definition at line 124 of file QueryParser.php.

References $GLOBALS, and TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\$tableName.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getCommandForPageJump().

◆ getId()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::getId (   $query)

Verify if an given query contains a page jump command.

Parameters
string$queryA valid value looks like '#14'
Returns
integer

Definition at line 86 of file QueryParser.php.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getCommandForPageJump().

◆ getSearchQueryValue()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::getSearchQueryValue (   $query)

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

Parameters
string$queryFor example #news:weather
Returns
string The extracted search value

Definition at line 60 of file QueryParser.php.

References TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\extractKeyFromQuery().

◆ getTableNameFromCommand()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::getTableNameFromCommand (   $query)

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

Parameters
string$query
Returns
string Database Table name

Definition at line 71 of file QueryParser.php.

References TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\$commandKey, $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\$tableName, and TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\extractKeyFromQuery().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\isValidCommand().

◆ isValidCommand()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::isValidCommand (   $query)

Verify if an given query contains an registered command key.

Parameters
string$query
Returns
boolean

Definition at line 110 of file QueryParser.php.

References TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getTableNameFromCommand().

◆ isValidPageJump()

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::isValidPageJump (   $query)

Verify if a given query contains a page jump command.

Parameters
string$queryA valid value looks like '#14'
Returns
boolean

Definition at line 96 of file QueryParser.php.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\QueryParser\getCommandForPageJump().

Member Data Documentation

◆ $commandKey

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::$commandKey = ''
protected

◆ $tableName

TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::$tableName = ''
protected

◆ COMMAND_KEY_INDICATOR

const TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::COMMAND_KEY_INDICATOR = '#'

Definition at line 37 of file QueryParser.php.

◆ COMMAND_SPLIT_INDICATOR

const TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::COMMAND_SPLIT_INDICATOR = ':'

Definition at line 41 of file QueryParser.php.