DatabaseTreeDataProvider

class \TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeDataProvider

Extends
AbstractTableConfigurationTreeDataProvider

TCA tree data provider

Attributes

#[Autoconfigure]
$public: true
$shared: false

Table of Contents

Constants

MODE_CHILDREN  : mixed = 1
MODE_PARENT  : mixed = 2

Properties

$availableItems  : array
$columnConfiguration  : array<string, mixed>
Stores TCA-Configuration of the LookUpField in tableName
$eventDispatcher  : EventDispatcherInterface
$expandAll  : bool
$expandedList  : string
$idCache  : array
$itemUnselectableList  : array
Contains all ids which are not allowed to be selected
$itemWhiteList  : array
Contains all ids which may be allowed to display according to beUser Rights and foreign_table_where (if type db)
$labelField  : string
$levelMaximum  : int
$lookupField  : string
$lookupMode  : self::MODE_*
$nodeSortValues  : array<string, mixed>
node sort values (the orderings from foreign_Table_where evaluation)
$nonSelectableLevelList  : string
$rootNode  : TreeRepresentationNode
Root Node
$schema  : TcaSchema|null
$selectedList  : string
$startingPoints  : int[]
$tableName  : string
$tableWhere  : string
$treeData  : TreeNode
$treeId  : string
$unselectableItemsIncludeDescendants  : bool
Whether descendants of unselectable items are unselectable as well (parent mode only)

Methods

__construct()  : mixed
getExpandAll()  : bool
Gets the expandAll
getItemUnselectableList()  : array
Getter for $itemUnselectableList
getItemWhiteList()  : array
Getter for the itemWhiteList
getLabelField()  : string
Gets the label field
getLevelMaximum()  : int
Gets the levelMaximum
getLookupField()  : string
Gets the lookup field
getLookupMode()  : self::MODE_*
Gets the lookup mode
getNodes()  : void
Gets the nodes
getNonSelectableLevelList()  : string
Gets the list for non selectable tree levels
getRoot()  : TreeRepresentationNode
Gets the root node
getSelectedList()  : string
Gets the list for selected nodes
getStartingPoints()  : int[]
getTableName()  : string
Gets the table name
getTableWhere()  : string
Gets the tableWhere clause
getTreeId()  : string
Gets the id of the tree
getUnselectableItemsIncludeDescendants()  : bool
initializeTreeData()  : void
Init the tree data
setAvailableItems()  : mixed
setExpandAll()  : mixed
Sets the expandAll
setItemUnselectableList()  : mixed
Setter for $itemUnselectableList
setItemWhiteList()  : mixed
Setter for the itemWhiteList
setLabelField()  : void
Sets the label field
setLevelMaximum()  : mixed
Sets the levelMaximum
setLookupField()  : void
Sets the lookup field
setLookupMode()  : void
Sets the lookup mode
setNonSelectableLevelList()  : mixed
Sets the list for non selectable tree levels
setSelectedList()  : mixed
Sets the list for selected nodes
setStartingPoints()  : void
setTableName()  : void
Sets the table name
setTableWhere()  : void
Sets the tableWhere clause
setTreeId()  : mixed
Sets the id of the tree
setUnselectableItemsIncludeDescendants()  : void
Sets whether descendants of unselectable items are unselectable as well (parent mode only)
addDescendantsToItemUnselectableList()  : void
Adds all descendants of the unselectable items to the list of unselectable items, as selecting one of them as parent would create a loop. Descendants are resolved from the available items and the database, so they are found even if an intermediate item is not part of the displayed tree, e.g. due to TSconfig "removeItems", starting points or category mounts.
buildRepresentationForNode()  : DatabaseTreeNode
Builds a complete node including children
getChildrenOf()  : TreeNodeCollection|null
Gets node children
getChildrenUidsFromChildrenRelation()  : array
Gets related children records depending on TCA configuration
getChildrenUidsFromParentRelation()  : array
Gets related records depending on TCA configuration
getLanguageService()  : LanguageService|null
getRelatedRecords()  : array
Gets related records depending on TCA configuration
isExpanded()  : bool
Gets the expanded state of a given node
listFieldQuery()  : int[]
Queries the table for a field which might contain a list.
loadTreeData()  : void
Loads the tree data (all possible children)

Constants

MODE_CHILDREN

public mixed MODE_CHILDREN = 1

Properties

$availableItems

protected array $availableItems = []

Tags

todo:

This is a hack to speed up category tree calculation. See the comments in TcaCategory and AbstractItemProvider FormEngine classes.

$columnConfiguration

Stores TCA-Configuration of the LookUpField in tableName

protected array<string, mixed> $columnConfiguration

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

$expandAll

protected bool $expandAll = false

$expandedList

protected string $expandedList = ''

$itemUnselectableList

Contains all ids which are not allowed to be selected

protected array $itemUnselectableList = []

$itemWhiteList

Contains all ids which may be allowed to display according to beUser Rights and foreign_table_where (if type db)

protected array $itemWhiteList = []

$labelField

protected string $labelField = ''

$levelMaximum

protected int $levelMaximum = 4

$lookupField

protected string $lookupField = ''

$lookupMode

protected self::MODE_* $lookupMode = self::MODE_CHILDREN

$nodeSortValues

node sort values (the orderings from foreign_Table_where evaluation)

protected array<string, mixed> $nodeSortValues = []

$nonSelectableLevelList

protected string $nonSelectableLevelList = '0'

$selectedList

protected string $selectedList = ''

$startingPoints

protected int[] $startingPoints = [0]

$tableName

protected string $tableName = ''

$tableWhere

protected string $tableWhere = ''

$unselectableItemsIncludeDescendants

Whether descendants of unselectable items are unselectable as well (parent mode only)

protected bool $unselectableItemsIncludeDescendants = false

Methods

__construct()

public __construct(EventDispatcherInterface $eventDispatcher) : mixed

Parameters

$eventDispatcher : EventDispatcherInterface

getExpandAll()

Gets the expandAll

public getExpandAll() : bool

Return values

bool

getItemUnselectableList()

Getter for $itemUnselectableList

public getItemUnselectableList() : array

Return values

array

getItemWhiteList()

Getter for the itemWhiteList

public getItemWhiteList() : array

Return values

array

getLabelField()

Gets the label field

public getLabelField() : string

Return values

string

getLevelMaximum()

Gets the levelMaximum

public getLevelMaximum() : int

Return values

int

getLookupField()

Gets the lookup field

public getLookupField() : string

Return values

string

getLookupMode()

Gets the lookup mode

public getLookupMode() : self::MODE_*

Return values

self::MODE_*

getNonSelectableLevelList()

Gets the list for non selectable tree levels

public getNonSelectableLevelList() : string

Return values

string

getSelectedList()

Gets the list for selected nodes

public getSelectedList() : string

Return values

string

getStartingPoints()

public getStartingPoints() : int[]

Return values

int[]

getTableName()

Gets the table name

public getTableName() : string

Return values

string

getTableWhere()

Gets the tableWhere clause

public getTableWhere() : string

Return values

string

getTreeId()

Gets the id of the tree

public getTreeId() : string

Return values

string

getUnselectableItemsIncludeDescendants()

public getUnselectableItemsIncludeDescendants() : bool

Return values

bool

setAvailableItems()

public setAvailableItems(array $availableItems) : mixed

Parameters

$availableItems : array

setExpandAll()

Sets the expandAll

public setExpandAll(bool $expandAll) : mixed

Parameters

$expandAll : bool

setItemUnselectableList()

Setter for $itemUnselectableList

public setItemUnselectableList(array $itemUnselectableList) : mixed

Parameters

$itemUnselectableList : array

setItemWhiteList()

Setter for the itemWhiteList

public setItemWhiteList(array $itemWhiteList) : mixed

Parameters

$itemWhiteList : array

setLabelField()

Sets the label field

public setLabelField(string $labelField) : void

Parameters

$labelField : string

setLevelMaximum()

Sets the levelMaximum

public setLevelMaximum(int $levelMaximum) : mixed

Parameters

$levelMaximum : int

setLookupField()

Sets the lookup field

public setLookupField(string $lookupField) : void

Parameters

$lookupField : string

setLookupMode()

Sets the lookup mode

public setLookupMode(self::MODE_* $lookupMode) : void

Parameters

$lookupMode : self::MODE_*

setNonSelectableLevelList()

Sets the list for non selectable tree levels

public setNonSelectableLevelList(string $nonSelectableLevelList) : mixed

Parameters

$nonSelectableLevelList : string

setSelectedList()

Sets the list for selected nodes

public setSelectedList(string $selectedList) : mixed

Parameters

$selectedList : string

setStartingPoints()

public setStartingPoints(int[] $startingPoints) : void

Parameters

$startingPoints : int[]

setTableName()

Sets the table name

public setTableName(string $tableName) : void

Parameters

$tableName : string

setTableWhere()

Sets the tableWhere clause

public setTableWhere(string $tableWhere) : void

Parameters

$tableWhere : string

setTreeId()

Sets the id of the tree

public setTreeId(string $treeId) : mixed

Parameters

$treeId : string

setUnselectableItemsIncludeDescendants()

Sets whether descendants of unselectable items are unselectable as well (parent mode only)

public setUnselectableItemsIncludeDescendants(bool $unselectableItemsIncludeDescendants) : void

Parameters

$unselectableItemsIncludeDescendants : bool

addDescendantsToItemUnselectableList()

Adds all descendants of the unselectable items to the list of unselectable items, as selecting one of them as parent would create a loop. Descendants are resolved from the available items and the database, so they are found even if an intermediate item is not part of the displayed tree, e.g. due to TSconfig "removeItems", starting points or category mounts.

protected addDescendantsToItemUnselectableList() : void

getChildrenUidsFromChildrenRelation()

Gets related children records depending on TCA configuration

protected getChildrenUidsFromChildrenRelation(array $row) : array

Parameters

$row : array

Return values

array

getChildrenUidsFromParentRelation()

Gets related records depending on TCA configuration

protected getChildrenUidsFromParentRelation(array $row) : array

Parameters

$row : array

Return values

array

getRelatedRecords()

Gets related records depending on TCA configuration

protected getRelatedRecords(array $row) : array

Parameters

$row : array

Return values

array

isExpanded()

Gets the expanded state of a given node

protected isExpanded(TreeNode $node) : bool

Parameters

$node : TreeNode

Return values

bool

listFieldQuery()

Queries the table for a field which might contain a list.

protected listFieldQuery(string $fieldName, int $queryId) : int[]

Parameters

$fieldName : string

the name of the field to be queried

$queryId : int

the uid to search for

Return values

int[] —

all uids found

loadTreeData()

Loads the tree data (all possible children)

protected loadTreeData() : void
On this page