SuggestWizardDefaultReceiver
Default implementation of a handler class for an ajax record selector.
Normally other implementations should be inherited from this one. queryTable() should not be overwritten under normal circumstances.
Table of Contents
Properties
- $allowedPages : array<string|int, mixed>
- The list of pages that are allowed to perform the search for records on
- $config : array<string|int, mixed>
- Configuration for this selector from TSconfig
- $iconFactory : IconFactory
- $maxItems : int
- The maximum number of items to select.
- $mmForeignTable : string
- The name of the foreign table to query (records from this table will be used for displaying instead of the ones from $table)
- $params : array<string|int, mixed>
- $queryBuilder : QueryBuilder
- $table : string
- The name of the table to query
Methods
- __construct() : mixed
- The constructor of this class
- queryTable() : array<string|int, mixed>
- Queries a table for records and completely processes them
- buildConstraintBlock() : string|CompositeExpression
- Creates OR constraints for each split searchWord.
- checkRecordAccess() : bool
- Selects whether the logged in Backend User is allowed to read a specific record
- getAvailablePageIds() : array<string|int, mixed>
- Get array of page ids from given page id and depth
- getLabel() : string
- Returns a label for a given record; usually only a wrapper for \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle
- getLanguageService() : LanguageService
- getQueryBuilderForTable() : QueryBuilder
- getRecordPath() : string
- Returns the path for a record. Is the whole path for all records except pages - for these the last part is cut off, because it contains the pagetitle itself, which would be double information
- makeWorkspaceOverlay() : mixed
- Overlay the given record with its workspace-version, if any
- manipulateRecord() : mixed
- Manipulate a record before using it to render the selector; may be used to replace a MM-relation etc.
- prepareOrderByStatement() : mixed
- Prepares the clause by which the result elements are sorted. See description of ORDER BY in SQL standard for reference.
- prepareSelectStatement() : mixed
- Prepare the statement for selecting the records which will be returned to the selector. May also return some other records (e.g. from a mm-table) which will be used later on to select the real records
- renderRecord() : array<string|int, mixed>
- Calls a user function for rendering the page.
- splitSearchString() : array<string|int, mixed>
- Splits the search string by space This allows searching for 'elements basic' and will find results like "elements rte basic" To search for whole phrases enclose by double-quotes: '"elements basic"', results in empty result
Properties
$allowedPages
The list of pages that are allowed to perform the search for records on
        protected
            array<string|int, mixed>
    $allowedPages
     = []
    
        Array of PIDs
$config
Configuration for this selector from TSconfig
        protected
            array<string|int, mixed>
    $config
     = []
    
    
    
    
    
$iconFactory
        protected
            IconFactory
    $iconFactory
    
    
    
    
    
    
$maxItems
The maximum number of items to select.
        protected
            int
    $maxItems
     = 10
    
    
    
    
    
$mmForeignTable
The name of the foreign table to query (records from this table will be used for displaying instead of the ones from $table)
        protected
            string
    $mmForeignTable
     = ''
    
    
    
    
    
$params
        protected
            array<string|int, mixed>
    $params
     = []
    
    
    
    
    
$queryBuilder
        protected
            QueryBuilder
    $queryBuilder
    
    
    
    
    
    
$table
The name of the table to query
        protected
            string
    $table
     = ''
    
    
    
    
    
Methods
__construct()
The constructor of this class
    public
                    __construct(string $table, array<string|int, mixed> $config) : mixed
    Parameters
- $table : string
- 
                    The table to query 
- $config : array<string|int, mixed>
- 
                    The configuration (TCA overlaid with TSconfig) to use for this selector 
queryTable()
Queries a table for records and completely processes them
    public
                    queryTable(array<string|int, mixed> &$params[, int $recursionCounter = 0 ]) : array<string|int, mixed>
    Returns a two-dimensional array of almost finished records; the only need to be put into a
If you subclass this class, you will most likely only want to overwrite the functions called from here, but not this function itself
Parameters
- $params : array<string|int, mixed>
- $recursionCounter : int = 0
- 
                    The parent object 
Return values
array<string|int, mixed> —Array of rows or FALSE if nothing found
buildConstraintBlock()
Creates OR constraints for each split searchWord.
    protected
                    buildConstraintBlock(string $searchString) : string|CompositeExpression
    Parameters
- $searchString : string
Return values
string|CompositeExpressioncheckRecordAccess()
Selects whether the logged in Backend User is allowed to read a specific record
    protected
                    checkRecordAccess(array<string|int, mixed> $row, int $uid) : bool
    Parameters
- $row : array<string|int, mixed>
- $uid : int
Return values
boolgetAvailablePageIds()
Get array of page ids from given page id and depth
    protected
                    getAvailablePageIds(int $id[, int $depth = 0 ]) : array<string|int, mixed>
    Parameters
- $id : int
- 
                    Page id. 
- $depth : int = 0
- 
                    Depth to go down. 
Return values
array<string|int, mixed> —of all page ids
getLabel()
Returns a label for a given record; usually only a wrapper for \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle
    protected
                    getLabel(array<string|int, mixed> $row) : string
    Parameters
- $row : array<string|int, mixed>
- 
                    The record to get the label for 
Return values
string —The label
getLanguageService()
    protected
                    getLanguageService() : LanguageService
    Return values
LanguageServicegetQueryBuilderForTable()
    protected
                    getQueryBuilderForTable(string $table) : QueryBuilder
    Parameters
- $table : string
Return values
QueryBuildergetRecordPath()
Returns the path for a record. Is the whole path for all records except pages - for these the last part is cut off, because it contains the pagetitle itself, which would be double information
    protected
                    getRecordPath(array<string|int, mixed> &$row, int $uid) : string
    The path is returned uncut, cutting has to be done by calling function.
Parameters
- $row : array<string|int, mixed>
- 
                    The row 
- $uid : int
- 
                    UID of the record 
Return values
string —The record-path
makeWorkspaceOverlay()
Overlay the given record with its workspace-version, if any
    protected
                    makeWorkspaceOverlay(array<string|int, mixed> &$row) : mixed
    Parameters
- $row : array<string|int, mixed>
- 
                    The record to get the workspace version for 
manipulateRecord()
Manipulate a record before using it to render the selector; may be used to replace a MM-relation etc.
    protected
                    manipulateRecord(array<string|int, mixed> &$row) : mixed
    Parameters
- $row : array<string|int, mixed>
prepareOrderByStatement()
Prepares the clause by which the result elements are sorted. See description of ORDER BY in SQL standard for reference.
    protected
                    prepareOrderByStatement() : mixed
    prepareSelectStatement()
Prepare the statement for selecting the records which will be returned to the selector. May also return some other records (e.g. from a mm-table) which will be used later on to select the real records
    protected
                    prepareSelectStatement() : mixed
    renderRecord()
Calls a user function for rendering the page.
    protected
                    renderRecord(array<string|int, mixed> $row, array<string|int, mixed> $entry) : array<string|int, mixed>
    This user function should manipulate $entry, especially $entry['text'].
Parameters
- $row : array<string|int, mixed>
- 
                    The row 
- $entry : array<string|int, mixed>
- 
                    The entry to render 
Return values
array<string|int, mixed> —The rendered entry (will be put into a
splitSearchString()
Splits the search string by space This allows searching for 'elements basic' and will find results like "elements rte basic" To search for whole phrases enclose by double-quotes: '"elements basic"', results in empty result
    protected
                    splitSearchString(string $searchString) : array<string|int, mixed>
    Parameters
- $searchString : string