DatabaseTreeDataProvider
class \
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
MODE_PARENT
public
mixed
MODE_PARENT
= 2
Properties
$availableItems
protected
array
$availableItems
= []
Internal
Tags
$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
= ''
$idCache
protected
array
$idCache
= []
$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'
$rootNode
Root Node
protected
TreeRepresentationNode
$rootNode
$schema
protected
TcaSchema|null
$schema
= null
$selectedList
protected
string
$selectedList
= ''
$startingPoints
protected
int[]
$startingPoints
= [0]
$tableName
protected
string
$tableName
= ''
$tableWhere
protected
string
$tableWhere
= ''
$treeData
protected
TreeNode
$treeData
$treeId
protected
string
$treeId
= ''
$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
boolgetItemUnselectableList()
Getter for $itemUnselectableList
public
getItemUnselectableList() : array
Return values
arraygetItemWhiteList()
Getter for the itemWhiteList
public
getItemWhiteList() : array
Return values
arraygetLabelField()
Gets the label field
public
getLabelField() : string
Return values
stringgetLevelMaximum()
Gets the levelMaximum
public
getLevelMaximum() : int
Return values
intgetLookupField()
Gets the lookup field
public
getLookupField() : string
Return values
stringgetLookupMode()
Gets the lookup mode
public
getLookupMode() : self::MODE_*
Return values
self::MODE_*getNodes()
Gets the nodes
public
getNodes(TreeNode $node) : void
Parameters
- $node : TreeNode
getNonSelectableLevelList()
Gets the list for non selectable tree levels
public
getNonSelectableLevelList() : string
Return values
stringgetRoot()
Gets the root node
public
getRoot() : TreeRepresentationNode
Return values
TreeRepresentationNodegetSelectedList()
Gets the list for selected nodes
public
getSelectedList() : string
Return values
stringgetStartingPoints()
public
getStartingPoints() : int[]
Return values
int[]getTableName()
Gets the table name
public
getTableName() : string
Return values
stringgetTableWhere()
Gets the tableWhere clause
public
getTableWhere() : string
Return values
stringgetTreeId()
Gets the id of the tree
public
getTreeId() : string
Return values
stringgetUnselectableItemsIncludeDescendants()
public
getUnselectableItemsIncludeDescendants() : bool
Return values
boolinitializeTreeData()
Init the tree data
public
initializeTreeData() : void
setAvailableItems()
public
setAvailableItems(array $availableItems) : mixed
Parameters
- $availableItems : array
Internal
See property comment
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
buildRepresentationForNode()
Builds a complete node including children
protected
buildRepresentationForNode(TreeNode $basicNode[, DatabaseTreeNode|null $parent = null ][, mixed $level = 0 ]) : DatabaseTreeNode
Parameters
- $basicNode : TreeNode
- $parent : DatabaseTreeNode|null = null
- $level : mixed = 0
Return values
DatabaseTreeNodegetChildrenOf()
Gets node children
protected
getChildrenOf(TreeNode $node, int $level) : TreeNodeCollection|null
Parameters
- $node : TreeNode
- $level : int
Return values
TreeNodeCollection|nullgetChildrenUidsFromChildrenRelation()
Gets related children records depending on TCA configuration
protected
getChildrenUidsFromChildrenRelation(array $row) : array
Parameters
- $row : array
Return values
arraygetChildrenUidsFromParentRelation()
Gets related records depending on TCA configuration
protected
getChildrenUidsFromParentRelation(array $row) : array
Parameters
- $row : array
Return values
arraygetLanguageService()
protected
getLanguageService() : LanguageService|null
Return values
LanguageService|nullgetRelatedRecords()
Gets related records depending on TCA configuration
protected
getRelatedRecords(array $row) : array
Parameters
- $row : array
Return values
arrayisExpanded()
Gets the expanded state of a given node
protected
isExpanded(TreeNode $node) : bool
Parameters
- $node : TreeNode
Return values
boollistFieldQuery()
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