Node
class Node (View source)
The Node is the building block for the collapsible navigation tree
Properties
string | $realName | ||
bool | $visible | ||
Node|null | $parent | ||
Node[] | $children | ||
string[] | $separators | ||
int | $separatorDepth | ||
array<string,string> | $icon | For the IMG tag, used when rendering the node. |
|
array<string,mixed> | $links | An array of A tags, used when rendering the node. |
|
string | $title | ||
string | $classes | ||
bool | $isNew | ||
int | $pos2 | ||
int | $pos3 | ||
string|null | $urlParamName |
Methods
Initialises the class by setting the mandatory variables
Instantiates a Node object that will be used only for "New db/table/etc.." objects
Returns a child node given it's name
Removes a child node from this node
Retrieves the parents for a node
Returns the actual parent of a node. If used twice on an index or columns node, it will return the table and database nodes. The names of the returned nodes can be used in SQL queries, etc.
This function checks if the node has children nodes associated with it
Returns true if the node has some siblings (other nodes on the same tree level, in the same branch), false otherwise.
Returns the actual path and the virtual paths for a node both as clean arrays and base64 encoded strings
Returns the names of children of type $type present inside this container This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes
Returns the number of children of type $type present inside this container This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes
Returns HTML for control buttons displayed infront of a node
Returns CSS classes for a node
Returns icon for the node
Gets the count of hidden elements for each database
Details
__construct(Config $config, string $name = '', NodeType $type = NodeType::Object, bool $isGroup = false)
Initialises the class by setting the mandatory variables
Node
getInstanceForNewNode(string $name, string $classes)
Instantiates a Node object that will be used only for "New db/table/etc.." objects
void
addChild(Node $child)
Adds a child node to this node
Node|null
getChild(string $name, bool $realName = false)
Returns a child node given it's name
void
removeChild(string $name)
Removes a child node from this node
array
parents(bool $self = false, bool $containers = false, bool $groups = false)
Retrieves the parents for a node
Node|false
getRealParent()
Returns the actual parent of a node. If used twice on an index or columns node, it will return the table and database nodes. The names of the returned nodes can be used in SQL queries, etc.
..
bool
hasChildren(bool $countEmptyContainers = true)
This function checks if the node has children nodes associated with it
bool
hasSiblings()
Returns true if the node has some siblings (other nodes on the same tree level, in the same branch), false otherwise.
The only exception is for nodes on the third level of the tree (columns and indexes), for which the function always returns true. This is because we want to render the containers for these nodes
array
getPaths()
Returns the actual path and the virtual paths for a node both as clean arrays and base64 encoded strings
array
getData(UserPrivileges $userPrivileges, RelationParameters $relationParameters, string $type, int $pos, string $searchClause = '')
Returns the names of children of type $type present inside this container This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes
int
getPresence(UserPrivileges $userPrivileges, string $type = '', string $searchClause = '')
Returns the number of children of type $type present inside this container This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes
string
getHtmlForControlButtons(NavigationItemsHidingFeature|null $navigationItemsHidingFeature)
Returns HTML for control buttons displayed infront of a node
string
getCssClasses(bool $match)
Returns CSS classes for a node
string
getIcon(bool $match)
Returns icon for the node
array|null
getNavigationHidingData(NavigationItemsHidingFeature|null $navigationItemsHidingFeature)
Gets the count of hidden elements for each database