DatabaseRecordProvider implements SearchProviderInterface
FinalYes
Search provider to query records from database
Table of Contents
Interfaces
- SearchProviderInterface
- Interface to declare a search provider used for the backend search
Properties
- $eventDispatcher : EventDispatcherInterface
- $iconFactory : IconFactory
- $languageService : LanguageService
- $languageServiceFactory : LanguageServiceFactory
- $pageIdList : array<string|int, mixed>
- $queryParser : QueryParser
- $uriBuilder : UriBuilder
- $userPermissions : string
Methods
- __construct() : mixed
- count() : int
- find() : array<string|int, ResultItem>
- getFilterLabel() : string
- buildConstraintsForTable() : array<string|int, CompositeExpression>
- canAccessTable() : bool
- countByTable() : int
- extractSearchableFieldsFromTable() : array<string|int, string>
- Get all fields from given table where we can search for.
- fieldTypeIsSearchable() : bool
- findByTable() : array<string|int, ResultItem>
- getAccessibleTables() : array<string|int, mixed>
- getBackendUser() : BackendUserAuthentication
- getEditLink() : string
- Build a backend edit link based on given record.
- getPageIdList() : array<string|int, int>
- List of available page uids for user, empty array for admin users.
- getQueryBuilderForTable() : QueryBuilder|null
- parseCommand() : array<string|int, mixed>
Properties
$eventDispatcher read-only
protected
EventDispatcherInterface
$eventDispatcher
$iconFactory read-only
protected
IconFactory
$iconFactory
$languageService
protected
LanguageService
$languageService
$languageServiceFactory read-only
protected
LanguageServiceFactory
$languageServiceFactory
$pageIdList
protected
array<string|int, mixed>
$pageIdList
= []
$queryParser read-only
protected
QueryParser
$queryParser
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
$userPermissions
protected
string
$userPermissions
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher, IconFactory $iconFactory, LanguageServiceFactory $languageServiceFactory, UriBuilder $uriBuilder, QueryParser $queryParser) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
- $iconFactory : IconFactory
- $languageServiceFactory : LanguageServiceFactory
- $uriBuilder : UriBuilder
- $queryParser : QueryParser
count()
public
count(SearchDemand $searchDemand) : int
Parameters
- $searchDemand : SearchDemand
Return values
intfind()
public
find(SearchDemand $searchDemand) : array<string|int, ResultItem>
Parameters
- $searchDemand : SearchDemand
Return values
array<string|int, ResultItem>getFilterLabel()
public
getFilterLabel() : string
Return values
stringbuildConstraintsForTable()
protected
buildConstraintsForTable(string $queryString, QueryBuilder $queryBuilder, string $tableName) : array<string|int, CompositeExpression>
Parameters
- $queryString : string
- $queryBuilder : QueryBuilder
- $tableName : string
Return values
array<string|int, CompositeExpression>canAccessTable()
protected
canAccessTable(string $tableName) : bool
Parameters
- $tableName : string
Return values
boolcountByTable()
protected
countByTable(SearchDemand $searchDemand, string $tableName) : int
Parameters
- $searchDemand : SearchDemand
- $tableName : string
Return values
intextractSearchableFieldsFromTable()
Get all fields from given table where we can search for.
protected
extractSearchableFieldsFromTable(string $tableName) : array<string|int, string>
Parameters
- $tableName : string
Return values
array<string|int, string>fieldTypeIsSearchable()
protected
fieldTypeIsSearchable(string $fieldType) : bool
Parameters
- $fieldType : string
Return values
boolfindByTable()
protected
findByTable(SearchDemand $searchDemand, string $tableName, int $limit, int $offset) : array<string|int, ResultItem>
Parameters
- $searchDemand : SearchDemand
- $tableName : string
- $limit : int
- $offset : int
Return values
array<string|int, ResultItem>getAccessibleTables()
protected
getAccessibleTables(BeforeSearchInDatabaseRecordProviderEvent $event) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>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.
getPageIdList()
List of available page uids for user, empty array for admin users.
protected
getPageIdList() : array<string|int, int>
Return values
array<string|int, int>getQueryBuilderForTable()
protected
getQueryBuilderForTable(SearchDemand $searchDemand, string $tableName) : QueryBuilder|null
Parameters
- $searchDemand : SearchDemand
- $tableName : string
Return values
QueryBuilder|nullparseCommand()
protected
parseCommand(SearchDemand $searchDemand) : array<string|int, mixed>
Parameters
- $searchDemand : SearchDemand