‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch Class Reference

Public Member Functions

 __construct ()
 
array find ($searchQuery)
 
 setLimitCount ($limitCount)
 
 setStartCount ($startCount)
 
 setQueryString ($queryString)
 

Public Attributes

const RECURSIVE_PAGE_LEVEL = 99
 

Protected Member Functions

array findByGlobalTableList ($pageIdList)
 
array findByTable ($tableName, $pageIdList, $firstResult, $maxResults)
 
array getRecordArray ($queryBuilder, $tableName)
 
string getEditLink ($tableName, $row)
 
string getTitleOfCurrentRecordType ($tableName)
 
CompositeExpression makeQuerySearchByTable (QueryBuilder &$queryBuilder, $tableName, array $fieldsToSearchWithin)
 
array extractSearchableFieldsFromTable ($tableName)
 
string getAvailablePageIds ($id, $depth)
 
 getBackendUser ()
 
LanguageService null getLanguageService ()
 

Protected Attributes

string $userPermissions = ''
 
QueryParser $queryParser
 

Private Attributes

string $queryString = ''
 
int $startCount = 0
 
int $limitCount = 5
 

Detailed Description

Class for handling backend live search.

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

Definition at line 41 of file LiveSearch.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::__construct ( )

Member Function Documentation

◆ extractSearchableFieldsFromTable()

array TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::extractSearchableFieldsFromTable (   $tableName)
protected

Get all fields from given table where we can search for.

Parameters
string$tableName‪Name of the table for which to get the searchable fields
Returns
‪array

Definition at line 389 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getBackendUser(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

◆ find()

array TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::find (   $searchQuery)

◆ findByGlobalTableList()

array TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findByGlobalTableList (   $pageIdList)
protected

Find records from all registered TCA table & column values.

Parameters
array$pageIdList‪Comma separated list of page IDs
Returns
‪array Records found in the database matching the searchQuery

Definition at line 112 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$limitCount, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable(), and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getBackendUser().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ findByTable()

array TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::findByTable (   $tableName,
  $pageIdList,
  $firstResult,
  $maxResults 
)
protected

Find records by given table name.

Parameters
string$tableName‪Database table name
array$pageIdList‪Comma separated list of page IDs
int$firstResult
int$maxResults
Returns
‪array Records found in the database matching the searchQuery
See also
getRecordArray()
makeQuerySearchByTable()
extractSearchableFieldsFromTable()

Definition at line 153 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\extractSearchableFieldsFromTable(), TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray(), and TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find(), and TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByGlobalTableList().

◆ getAvailablePageIds()

string TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getAvailablePageIds (   $id,
  $depth 
)
protected

Creates an instance of \TYPO3\CMS\Backend\Tree\View\PageTreeView which will select a page tree to $depth and return the object. In that object we will find the ids of the tree.

Parameters
int$id‪Page id.
int$depth‪Depth to go down.
Returns
‪string Comma separated list of uids

Definition at line 446 of file LiveSearch.php.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ getBackendUser()

◆ getEditLink()

string TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getEditLink (   $tableName,
  $row 
)
protected

Build a backend edit link based on given record.

Parameters
string$tableName‪Record table name
array$row‪Current record row from database.
Returns
‪string Link to open an edit window for record.
See also
‪\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess()

Definition at line 235 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Core\Type\Bitmask\Permission\CONTENT_EDIT, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getBackendUser(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_EDIT, and TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray().

◆ getLanguageService()

LanguageService null TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getLanguageService ( )
protected
Returns
‪LanguageService|null

Definition at line 469 of file LiveSearch.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getTitleOfCurrentRecordType().

◆ getRecordArray()

array TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getRecordArray (   $queryBuilder,
  $tableName 
)
protected

Process the Database operation to get the search result.

Parameters
QueryBuilder$queryBuilder‪Database table name
string$tableName
Returns
‪array
See also
‪getTitleFromCurrentRow()
getEditLink()

Definition at line 203 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getEditLink(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getTitleOfCurrentRecordType(), TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL, and TYPO3\CMS\Backend\Utility\BackendUtility\workspaceOL().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\findByTable().

◆ getTitleOfCurrentRecordType()

string TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::getTitleOfCurrentRecordType (   $tableName)
protected

Retrieve the record name

Parameters
string$tableName‪Record table name
Returns
‪string

Definition at line 272 of file LiveSearch.php.

References $GLOBALS, TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getLanguageService(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\getRecordArray().

◆ makeQuerySearchByTable()

◆ setLimitCount()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setLimitCount (   $limitCount)

Setter for limit value.

Parameters
int$limitCount

Definition at line 410 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$limitCount, and TYPO3\CMS\Core\Utility\MathUtility\convertToPositiveInteger().

◆ setQueryString()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setQueryString (   $queryString)

Setter for the search query string.

Parameters
string$queryString

Definition at line 433 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$queryString.

Referenced by TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\find().

◆ setStartCount()

TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::setStartCount (   $startCount)

Setter for start count value.

Parameters
int$startCount

Definition at line 423 of file LiveSearch.php.

References TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch\$startCount, and TYPO3\CMS\Core\Utility\MathUtility\convertToPositiveInteger().

Member Data Documentation

◆ $limitCount

int TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$limitCount = 5
private

◆ $queryParser

QueryParser TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$queryParser
protected

Definition at line 66 of file LiveSearch.php.

◆ $queryString

string TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$queryString = ''
private

◆ $startCount

int TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$startCount = 0
private

◆ $userPermissions

string TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::$userPermissions = ''
protected

Definition at line 62 of file LiveSearch.php.

◆ RECURSIVE_PAGE_LEVEL

const TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::RECURSIVE_PAGE_LEVEL = 99

Definition at line 46 of file LiveSearch.php.