LiveSearch
Class for handling backend live search.
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Constants
- RECURSIVE_PAGE_LEVEL = 99
Properties
- $queryParser : QueryParser
- $userPermissions : string
Methods
- __construct() : mixed
- Initialize access settings
- find() : array<string|int, mixed>
- Find records from database based on the given $searchQuery.
- setLimitCount() : mixed
- Setter for limit value.
- setQueryString() : mixed
- Setter for the search query string.
- setStartCount() : mixed
- Setter for start count value.
- extractSearchableFieldsFromTable() : array<string|int, mixed>
- Get all fields from given table where we can search for.
- findByGlobalTableList() : array<string|int, mixed>
- Find records from all registered TCA table & column values.
- findByTable() : array<string|int, mixed>
- Find records by given table name.
- getAvailablePageIds() : string
- 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.
- getBackendUser() : BackendUserAuthentication
- getEditLink() : string
- Build a backend edit link based on given record.
- getLanguageService() : LanguageService|null
- getPageIdList() : array<string|int, mixed>
- List of available page uids for user, empty array for admin users.
- getRecordArray() : array<string|int, mixed>
- Process the Database operation to get the search result.
- getTitleOfCurrentRecordType() : string
- Retrieve the record name
- makeQuerySearchByTable() : CompositeExpression
- Build the MySql where clause by table.
Constants
RECURSIVE_PAGE_LEVEL
public
int
RECURSIVE_PAGE_LEVEL
= 99
Properties
$queryParser
protected
QueryParser
$queryParser
$userPermissions
protected
string
$userPermissions
= ''
Methods
__construct()
Initialize access settings
public
__construct() : mixed
find()
Find records from database based on the given $searchQuery.
public
find(string $searchQuery) : array<string|int, mixed>
Parameters
- $searchQuery : string
Return values
array<string|int, mixed> —Result list of database search.
setLimitCount()
Setter for limit value.
public
setLimitCount(int $limitCount) : mixed
Parameters
- $limitCount : int
setQueryString()
Setter for the search query string.
public
setQueryString(string $queryString) : mixed
Parameters
- $queryString : string
setStartCount()
Setter for start count value.
public
setStartCount(int $startCount) : mixed
Parameters
- $startCount : int
extractSearchableFieldsFromTable()
Get all fields from given table where we can search for.
protected
extractSearchableFieldsFromTable(string $tableName) : array<string|int, mixed>
Parameters
- $tableName : string
-
Name of the table for which to get the searchable fields
Return values
array<string|int, mixed>findByGlobalTableList()
Find records from all registered TCA table & column values.
protected
findByGlobalTableList(array<string|int, mixed> $pageIdList) : array<string|int, mixed>
Parameters
- $pageIdList : array<string|int, mixed>
-
Comma separated list of page IDs
Return values
array<string|int, mixed> —Records found in the database matching the searchQuery
findByTable()
Find records by given table name.
protected
findByTable(string $tableName, array<string|int, mixed> $pageIdList, int $firstResult, int $maxResults) : array<string|int, mixed>
Parameters
- $tableName : string
-
Database table name
- $pageIdList : array<string|int, mixed>
-
Comma separated list of page IDs
- $firstResult : int
- $maxResults : int
Tags
Return values
array<string|int, mixed> —Records found in the database matching the searchQuery
getAvailablePageIds()
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.
protected
getAvailablePageIds(int $id, int $depth) : string
Parameters
- $id : int
-
Page id.
- $depth : int
-
Depth to go down.
Return values
string —Comma separated list of uids
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetEditLink()
Build a backend edit link based on given record.
protected
getEditLink(string $tableName, array<string|int, mixed> $row) : string
Parameters
- $tableName : string
-
Record table name
- $row : array<string|int, mixed>
-
Current record row from database.
Tags
Return values
string —Link to open an edit window for record.
getLanguageService()
protected
getLanguageService() : LanguageService|null
Return values
LanguageService|nullgetPageIdList()
List of available page uids for user, empty array for admin users.
protected
getPageIdList() : array<string|int, mixed>
Return values
array<string|int, mixed>getRecordArray()
Process the Database operation to get the search result.
protected
getRecordArray(QueryBuilder $queryBuilder, string $tableName) : array<string|int, mixed>
Parameters
- $queryBuilder : QueryBuilder
-
Database table name
- $tableName : string
Tags
Return values
array<string|int, mixed>getTitleOfCurrentRecordType()
Retrieve the record name
protected
getTitleOfCurrentRecordType(string $tableName) : string
Parameters
- $tableName : string
-
Record table name
Return values
stringmakeQuerySearchByTable()
Build the MySql where clause by table.
protected
makeQuerySearchByTable(QueryBuilder $queryBuilder, string $tableName, array<string|int, mixed> $fieldsToSearchWithin) : CompositeExpression
Parameters
- $queryBuilder : QueryBuilder
- $tableName : string
-
Record table name
- $fieldsToSearchWithin : array<string|int, mixed>
-
User right based visible fields where we can search within.