You are here

public function AccessControlHierarchyBase::getTree in Workbench Access 8

Gets the entire hierarchy tree.

This method will return a hierarcy tree from any supported source in a standard array structure. Using this method allows our code to abstract handling of access controls.

The array has the following components.

id - The lookup id of the entity or object (e.g. term tid). parents - A sorted array of ids for any parent items of this item. label - The human-readable label of the entity or object. description - A human-readable help description of this item. path - A fully-formed URL string for this item. depth - The depth in the hierarchy of this item. weight - The sort order (weight) of this item at its depth.

The first two items in this array (id, parents) are used to generate access control logic. The remaining items are used for building forms and user interfaces. Note that the last two items (depth, weight) are normally handled by the sorting done by the tree builder. They are provided in case your code needs to re-sort the tree.

Return value

array An array in the format defined above.

Overrides AccessControlHierarchyInterface::getTree

1 call to AccessControlHierarchyBase::getTree()
AccessControlHierarchyBase::load in src/AccessControlHierarchyBase.php
Loads a hierarchy definition for a single item in the tree.
3 methods override AccessControlHierarchyBase::getTree()
FilterAccess::getTree in tests/modules/workbench_access_filter_test/src/Plugin/AccessControlHierarchy/FilterAccess.php
Gets the entire hierarchy tree.
Menu::getTree in src/Plugin/AccessControlHierarchy/Menu.php
Gets the entire hierarchy tree.
Taxonomy::getTree in src/Plugin/AccessControlHierarchy/Taxonomy.php
Gets the entire hierarchy tree.

File

src/AccessControlHierarchyBase.php, line 161

Class

AccessControlHierarchyBase
Defines a base hierarchy class that others may extend.

Namespace

Drupal\workbench_access

Code

public function getTree() {
  return [];
}