Generic class to retrieve a tree collection for tree views.

 Methods

Create a new instance.

__construct(\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface $environment, \ContaoCommunityAlliance\DcGeneral\Panel\PanelContainerInterface $panel, array $sorting, \ContaoCommunityAlliance\DcGeneral\Controller\TreeNodeStates $states) 

Parameters

$sorting

array

The sorting information.

Collect all items from real root - without root id.

getChildrenOf(string $providerName, int $level, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $parentModel) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

Parameters

$providerName

string

The data provider from which the root element originates from.

$level

int

The level in the tree (TODO: isn't this always 0?).

$parentModel

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The optional parent model (mode 4 parent).

Returns

Retrieve the sorting information.

getSorting() : array

Returns

array

Recursively retrieve a collection of all complete node hierarchy.

getTreeCollectionRecursive(array $rootId, int $level, string $providerName) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

Parameters

$rootId

array

The ids of the root node.

$level

int

The level the items are residing on.

$providerName

string

The data provider from which the root element originates from.

Returns

Add the parent filtering to the given data config if any defined.

addParentFilter(\ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $parentModel) : void

Parameters

Exceptions

\RuntimeException When the parent provider does not match.

Put the base filter and sorting into a config.

calculateRootConfig() : \ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface

Check the state of a model and set the metadata accordingly.

determineModelState(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, int $level) : void

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model of which the state shall be checked of.

$level

int

The tree level the model is contained within.

Retrieve the child data provider names for the passed parent provider.

getChildProvidersOf(string $parentProvider, null|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\ModelRelationshipDefinitionInterface $relationships) : array

Parameters

$parentProvider

string

The name of the parent provider.

Returns

array

Retrieve the children of a model (if any exist).

getChildrenOfModel(\ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface $dataProvider, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, \ContaoCommunityAlliance\DcGeneral\DataDefinition\ModelRelationship\ParentChildConditionInterface $childCondition) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface | null

This "renders" a model for tree view.

treeWalkModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, int $intLevel, array $subTables) : void

Parameters

$intLevel

int

The current level in the tree hierarchy.

$subTables

array

The names of data providers that shall be rendered "below" this item.

 Properties

     

The sorting information.

$sorting : array
 

The tree node states that represent the current flags for the tree nodes.

$states : \ContaoCommunityAlliance\DcGeneral\Controller\TreeNodeStates